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

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:,,, 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!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Aidam-UnlimitedAuthor Commented:
Thanks but I do not understand how to use it and where is the jQuery validation?
b0lsc0ttIT ManagerCommented:
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.

Aidam-UnlimitedAuthor Commented:
Thanks both of you, guys. I'm gonna look for another solution.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.