PHP form > How to >
Sending form results to multiple recipients
Sending form results to multiple recipients
Need to send a copy of form results to your business partner? To your friend?
To someone helping you with a project?
So, how do you send the e-mail with form results to multiple recipients?
The answer is: easy! All you need to do is separate multiple e-mail
addresses in the PHP mail()
function (remember the Form to Mail tutorial?) with a comma ( , ).
As shown before to send an e-mail to john@doe.com you would use this PHP code:
mail("john@doe.com", "Test e-mail", "Hi, this is a test message!");
|
Now if you wanted to send a copy of the same e-mail also to jane@mail.com and frank@domain.com you would
just use all three (separated with a comma) as the first parameter in the mail() function:
"john@doe.com , jane@mail.com , frank@domain.com"
|
Now the code would look like this:
mail("john@doe.com , marry@mail.com , frank@domain.com",
"Test e-mail", "Hi, this is a test message!");
|
That's it!
» Copyright notice
© 2008-2024 myPHPform.com. All rights reserved. Copying or redistributing
any part of this website without our written permission is expressly
forbidden!
|
|