This is a discussion on Mail to more then one recipient? within the alt.comp.lang.php forums, part of the PHP Programming Forums category; When processing an email form, sometimes I want to send the email to two recipients: e.g. I am working ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
When processing an email form, sometimes I want to send the email to two
recipients: e.g. I am working as a volunteer for a vicary and the staff is not so familiar with the whole email stuff. Usually I just call the mail function two times so: mail(somebody@somewhere.com, "Reaction from your site" , $theMessage); mail(somebodyelse@somewhereelse.com, "Reaction from your site" , $theMessage); If there would be more recipients of course I could create an array called $theRecipients and walk through the array but I wonder if there are other, more practical alternatives. But mostly there are just 2 recipients (the company or organisation for which I made the site, and myself) so I also considered to write a small function mailTwice($theRecipient1, $theRecipient2, $subject, $text). Besides, I couldn't find any options on the web for the bcc and cc fields. Maybe I just entered the wrong search entries in Google, so I apologise if there is some info on the web and of course links to the appropiate sites are also welcome. Thx Martien van Wanrooij |
|
|||
|
Try separating the recipients using ";" !
mail("a@b.com; b@c.com; c@d.com", $subj, $msg); I guess it works but I am not sure. Paul www.eigelb.at "Martien van Wanrooij" <info@martienvanwanrooij.nl> schrieb im Newsbeitrag news:SfIyc.2716$9n5.236@amstwist00... > When processing an email form, sometimes I want to send the email to two > recipients: e.g. I am working as a volunteer for a vicary and the staff is > not so familiar with the whole email stuff. > Usually I just call the mail function two times so: > mail(somebody@somewhere.com, "Reaction from your site" , $theMessage); > mail(somebodyelse@somewhereelse.com, "Reaction from your site" , > $theMessage); > If there would be more recipients of course I could create an array called > $theRecipients and walk through the array but I wonder if there are other, > more practical alternatives. But mostly there are just 2 recipients (the > company or organisation for which I made the site, and myself) so I also > considered to write a small function mailTwice($theRecipient1, > $theRecipient2, $subject, $text). > Besides, I couldn't find any options on the web for the bcc and cc fields. > Maybe I just entered the wrong search entries in Google, so I apologise if > there is some info on the web and of course links to the appropiate sites > are also welcome. > > Thx > Martien van Wanrooij > > |
|
|||
|
http://www.php.net/manual/en/function.mail.php
says: Multiple recipients can be specified by putting a comma between each address in "to". The same place will help you set up a "Cc:" header too if you want. On Sat, 12 Jun 2004 20:50:16 +0200, "Martien van Wanrooij" <info@martienvanwanrooij.nl> wrote: >When processing an email form, sometimes I want to send the email to two >recipients: e.g. I am working as a volunteer for a vicary and the staff is >not so familiar with the whole email stuff. >Usually I just call the mail function two times so: >mail(somebody@somewhere.com, "Reaction from your site" , $theMessage); >mail(somebodyelse@somewhereelse.com, "Reaction from your site" , >$theMessage); >If there would be more recipients of course I could create an array called >$theRecipients and walk through the array but I wonder if there are other, >more practical alternatives. But mostly there are just 2 recipients (the >company or organisation for which I made the site, and myself) so I also >considered to write a small function mailTwice($theRecipient1, >$theRecipient2, $subject, $text). >Besides, I couldn't find any options on the web for the bcc and cc fields. >Maybe I just entered the wrong search entries in Google, so I apologise if >there is some info on the web and of course links to the appropiate sites >are also welcome. > >Thx >Martien van Wanrooij > |
|
|||
|
<shortbackandsides.no@spam.hairdresser.net> schreef in bericht news:ljmmc09j4g3e6kv2tejlv9ops0jfc35sn4@4ax.com... > http://www.php.net/manual/en/function.mail.php > says: Multiple recipients can be specified by putting a comma between > each address in "to". Thank you, never thought it would be that simple :-) |