Mail to more then one recipient?

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 ...


Go Back   Usenet Forums > PHP Programming Forums > alt.comp.lang.php

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-12-2004
Martien van Wanrooij
 
Posts: n/a
Default Mail to more then one recipient?

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


Reply With Quote
  #2 (permalink)  
Old 06-12-2004
Paul Schmidinger
 
Posts: n/a
Default Re: Mail to more then one recipient?

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
>
>



Reply With Quote
  #3 (permalink)  
Old 06-12-2004
shortbackandsides.no@spam.hairdresser.net
 
Posts: n/a
Default Re: Mail to more then one recipient?

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
>


Reply With Quote
  #4 (permalink)  
Old 06-13-2004
Martien van Wanrooij
 
Posts: n/a
Default Re: Mail to more then one recipient?


<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 :-)


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 10:19 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0