Multiple recipients

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


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 01-21-2004
Keru
 
Posts: n/a
Default Multiple recipients

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");
Reply With Quote
  #2 (permalink)  
Old 01-21-2004
Michel
 
Posts: n/a
Default Re: Multiple recipients

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");



Reply With Quote
  #3 (permalink)  
Old 01-22-2004
Keru
 
Posts: n/a
Default Re: Multiple recipients

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");

Reply With Quote
  #4 (permalink)  
Old 01-22-2004
Manuel Lemos
 
Posts: n/a
Default Re: Multiple recipients

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/

Reply With Quote
  #5 (permalink)  
Old 01-23-2004
Savut
 
Posts: n/a
Default Re: Multiple recipients

$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");



Reply With Quote
  #6 (permalink)  
Old 01-24-2004
Janwillem Borleffs
 
Posts: n/a
Default Re: Multiple recipients

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



Reply With Quote
  #7 (permalink)  
Old 01-24-2004
Keru
 
Posts: n/a
Default Re: Multiple recipients

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");

Reply With Quote
  #8 (permalink)  
Old 01-29-2004
Keru
 
Posts: n/a
Default Re: Multiple recipients

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

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 02:30 PM.


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