[Webinar] Streamline your web hosting managementRegister Today


PHP Send E-mail -> Multiple Recipients -> jQuery Validation

Posted on 2010-03-29
Medium Priority
Last Modified: 2012-05-09
Hi Guys,

I am using this jQuery PHP send-mail form:

I'd like to ask you if you could suggest me ready solution how to edit above code to accept and validate multiple e-mail separated by comma.


When I type first e-mail:

it will automatically add comma and space so I can type another e-mail in this one field:
hello@email.com, hello2@email.com, hello3@email.com, etc.

There will be maximum of 20 recipients.

I am sure I'm not the only one who would be delighted by this solution as I couldn't find any ready made jQuery multiple e-mail validation form.

Thank you in advance!
Question by:Aidam-Unlimited
  • 2
LVL 13

Accepted Solution

themrrobert earned 1000 total points
ID: 29007642
I do this my own way.

I have the mail 'loop' at the bottom that performs the tasks, and I use php to split(',',$emails)

and run a foreach($emails as $email) {

//run validation and/or email sending code


Author Comment

ID: 29010079
Thanks but I do not understand how to use it and where is the jQuery validation?
LVL 54

Assisted Solution

b0lsc0tt earned 1000 total points
ID: 29278860
I don't find a ready solution for that code.  You would either need to adapt the code and add the functionality (if that doesn't violate the license for use of the code) or create your own.  The expert above is correct about how you would do it.  In both the jQuery and PHP you would take the input from the address field and split it.  The specific code will depend on the language but you should do it in both (or at least in PHP for sure).  The reason to do it in jQuery too would just be for validation.

To implement both will take a little work and some understanding of both languages.  Is this something you can and want to do on your own?  The premade solution for the script you have doesn't exist (and the creator has said he won't be enhancing that code).  There are probably other solutions that will support multiple addresses but may not have all the other features (or may need you to make the form, add the jQuery or piece them together).  I hope this helps in general.  If you have a question about this or need specific help on a part then please let us know.  However the ready made solution to add to what you have above doesn't seem to exist.


Author Closing Comment

ID: 31708520
Thanks both of you, guys. I'm gonna look for another solution.

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
Suggested Courses

591 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question