This is a discussion on Multiple recipients within the alt.comp.lang.php forums, part of the PHP Programming Forums category; Hi I have an mail form. I have multiple address in the form but only the first email address gets ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi I have an mail form. I have multiple address in the form but only
the first email address gets the form mailed. What am I doing wrong. Any help will be appreciated. Thanks in advance. Here is the code $message = stripslashes($message); mail("johndoe@domain.com,janedoe@domain.com","Onli ne registration",$message,"From: online@domain.com<online@domain.com>"); $make=fopen("admin/data.dat","a"); $to_put=""; $to_put .= $EventID."|".$Form_Type."|".$Pin."|".$Title."|".$F irstName."|".$FamilyName."|".$Organisation."|".$Ad dress1."|".$Address1."|".$SuburbCity."|".$Country. "|".$PhoneB."|".$FaxB."|".$PhoneM."|".$Email"|".$U serDefined2."|".$UserDefined3." "; fwrite($make,$to_put); header("Refresh: 0;url=http://www.domain.com/thanks.htm"); |
|
|||
|
Put the recips in an array and loop your script through.
M "Keru" <arian@rocketmail.com> wrote in message news:b21774b9.0401210437.2ca80f6d@posting.google.c om... > Hi I have an mail form. I have multiple address in the form but only > the first email address gets the form mailed. What am I doing wrong. > Any help will be appreciated. > Thanks in advance. > > Here is the code > $message = stripslashes($message); > mail("johndoe@domain.com,janedoe@domain.com","Onli ne > registration",$message,"From: online@domain.com<online@domain.com>"); > $make=fopen("admin/data.dat","a"); > $to_put=""; > $to_put .= $EventID."|".$Form_Type."|".$Pin."|".$Title."|".$F irstName."|".$FamilyName." |".$Organisation."|".$Address1."|".$Address1."|".$ SuburbCity."|".$Country."| ".$PhoneB."|".$FaxB."|".$PhoneM."|".$Email"|".$Use rDefined2."|".$UserDefined 3." > "; > fwrite($make,$to_put); > header("Refresh: 0;url=http://www.domain.com/thanks.htm"); |
|
|||
|
Thank you for the response.
Could you please give me an example. "Michel" <please_no@spam.nl> wrote in message news:<bultai$469$1@news.cistron.nl>... > Put the recips in an array and loop your script through. > > M > > "Keru" <arian@rocketmail.com> wrote in message > news:b21774b9.0401210437.2ca80f6d@posting.google.c om... > > Hi I have an mail form. I have multiple address in the form but only > > the first email address gets the form mailed. What am I doing wrong. > > Any help will be appreciated. > > Thanks in advance. > > > > Here is the code > > $message = stripslashes($message); > > mail("johndoe@domain.com,janedoe@domain.com","Onli ne > > registration",$message,"From: online@domain.com<online@domain.com>"); > > $make=fopen("admin/data.dat","a"); > > $to_put=""; > > $to_put .= > $EventID."|".$Form_Type."|".$Pin."|".$Title."|".$F irstName."|".$FamilyName." > |".$Organisation."|".$Address1."|".$Address1."|".$ SuburbCity."|".$Country."| > ".$PhoneB."|".$FaxB."|".$PhoneM."|".$Email"|".$Use rDefined2."|".$UserDefined > 3." > > "; > > fwrite($make,$to_put); > > header("Refresh: 0;url=http://www.domain.com/thanks.htm"); |
|
|||
|
Hello,
On 01/22/2004 10:14 AM, Keru wrote: > Thank you for the response. > Could you please give me an example. Take a look at this class that lets you compose and send personalized messages and comes with an example for doing that: http://www.phpclasses.org/mimemessage test_personalized_bulk_mail.php >>Put the recips in an array and loop your script through. -- Regards, Manuel Lemos Free ready to use OOP components written in PHP http://www.phpclasses.org/ MetaL - XML based meta-programming language http://www.meta-language.net/ |
|
|||
|
$message = stripslashes($message);
$email = array("joe@tata.com", "toto@titi.com", "blabla@coco.com"); for($i=0;$i<count($email);$i++) { mail("$email[$i]","Online registration",$message,"From: online@domain.com<online@domain.com>"); } $make=fopen("admin/data.dat","a"); $to_put=""; $to_put ..=$EventID."|".$Form_Type."|".$Pin."|".$Title."|" .$FirstName."|".$FamilyName .."|".$Organisation."|".$Address1."|".$Address1."| ".$SuburbCity."|".$Country. "|".$PhoneB."|".$FaxB."|".$PhoneM."|".$Email"|".$U serDefined2."|".$UserDefin ed3.""; fwrite($make, $to_put); header("Refresh: 0;url=http://www.domain.com/thanks.htm"); Savut "Keru" <arian@rocketmail.com> wrote in message news:b21774b9.0401220414.138b6e2e@posting.google.c om... > Thank you for the response. > Could you please give me an example. > > "Michel" <please_no@spam.nl> wrote in message news:<bultai$469$1@news.cistron.nl>... > > Put the recips in an array and loop your script through. > > > > M > > > > "Keru" <arian@rocketmail.com> wrote in message > > news:b21774b9.0401210437.2ca80f6d@posting.google.c om... > > > Hi I have an mail form. I have multiple address in the form but only > > > the first email address gets the form mailed. What am I doing wrong. > > > Any help will be appreciated. > > > Thanks in advance. > > > > > > Here is the code > > > $message = stripslashes($message); > > > mail("johndoe@domain.com,janedoe@domain.com","Onli ne > > > registration",$message,"From: online@domain.com<online@domain.com>"); > > > $make=fopen("admin/data.dat","a"); > > > $to_put=""; > > > $to_put .= > > $EventID."|".$Form_Type."|".$Pin."|".$Title."|".$F irstName."|".$FamilyName." > > |".$Organisation."|".$Address1."|".$Address1."|".$ SuburbCity."|".$Country."| > > ".$PhoneB."|".$FaxB."|".$PhoneM."|".$Email"|".$Use rDefined2."|".$UserDefined > > 3." > > > "; > > > fwrite($make,$to_put); > > > header("Refresh: 0;url=http://www.domain.com/thanks.htm"); |
|
|||
|
Keru wrote:
> Hi I have an mail form. I have multiple address in the form but only > the first email address gets the form mailed. What am I doing wrong. > Any help will be appreciated. > Thanks in advance. > $header = "Bcc: rcpt2@domain.com, rcpt3@domain.com, etc..."; mail("rcpt1@domain.com", "some subject", "some msg", $header); So, no need for a loop here... JW |
|
|||
|
Hi Savut
Thanks a ton for that example. It works great now. Regards Keru "Savut" <webki@hotmail.com> wrote in message news:<JmaQb.19576$U77.1592293@news20.bellglobal.co m>... > $message = stripslashes($message); > $email = array("joe@tata.com", "toto@titi.com", "blabla@coco.com"); > for($i=0;$i<count($email);$i++) { > mail("$email[$i]","Online registration",$message,"From: > online@domain.com<online@domain.com>"); > } > > $make=fopen("admin/data.dat","a"); > $to_put=""; > $to_put > .=$EventID."|".$Form_Type."|".$Pin."|".$Title."|". $FirstName."|".$FamilyName > ."|".$Organisation."|".$Address1."|".$Address1."|" .$SuburbCity."|".$Country. > "|".$PhoneB."|".$FaxB."|".$PhoneM."|".$Email"|".$U serDefined2."|".$UserDefin > ed3.""; > fwrite($make, $to_put); > > header("Refresh: 0;url=http://www.domain.com/thanks.htm"); > > Savut > > "Keru" <arian@rocketmail.com> wrote in message > news:b21774b9.0401220414.138b6e2e@posting.google.c om... > > Thank you for the response. > > Could you please give me an example. > > > > "Michel" <please_no@spam.nl> wrote in message > news:<bultai$469$1@news.cistron.nl>... > > > Put the recips in an array and loop your script through. > > > > > > M > > > > > > "Keru" <arian@rocketmail.com> wrote in message > > > news:b21774b9.0401210437.2ca80f6d@posting.google.c om... > > > > Hi I have an mail form. I have multiple address in the form but only > > > > the first email address gets the form mailed. What am I doing wrong. > > > > Any help will be appreciated. > > > > Thanks in advance. > > > > > > > > Here is the code > > > > $message = stripslashes($message); > > > > mail("johndoe@domain.com,janedoe@domain.com","Onli ne > > > > registration",$message,"From: online@domain.com<online@domain.com>"); > > > > $make=fopen("admin/data.dat","a"); > > > > $to_put=""; > > > > $to_put .= > > > > $EventID."|".$Form_Type."|".$Pin."|".$Title."|".$F irstName."|".$FamilyName." > > > > ".$Organisation."|".$Address1."|".$Address1."|".$S uburbCity."|".$Country."| > > > > ".$PhoneB."|".$FaxB."|".$PhoneM."|".$Email"|".$Use rDefined2."|".$UserDefined > > > 3." > > > > "; > > > > fwrite($make,$to_put); > > > > header("Refresh: 0;url=http://www.domain.com/thanks.htm"); |
|
|||
|
Hi JW
When I used the bcc I got the following error. <Bcc: sara@doamin.com,john@doamin.com>: xxx.41.121.xx does not like recipient. Remote host said: 551 Delivery not allowed to non-local recipient Giving up on xxx.41.xxx.66. <roger@domain.com>: xxx.25.188.xx failed after I sent the message. Remote host said: 550 Administrative prohibition I took out the bcc in header and it seems to work fine. Thanks a lot for your help Regards Keru "Janwillem Borleffs" <jw@jwscripts.com> wrote in message news:<4012393c$0$91938$ee9da40f@news.wanadoo.nl>.. . > Keru wrote: > > Hi I have an mail form. I have multiple address in the form but only > > the first email address gets the form mailed. What am I doing wrong. > > Any help will be appreciated. > > Thanks in advance. > > > > $header = "Bcc: rcpt2@domain.com, rcpt3@domain.com, etc..."; > > mail("rcpt1@domain.com", "some subject", "some msg", $header); > > So, no need for a loop here... > > > JW |