RE: [PHP] Printing the output of a loop in an e-mail

From: Date: Wed, 03 Jan 2001 23:34:35 +0000
Subject: RE: [PHP] Printing the output of a loop in an e-mail
Groups: php.general 
Request: Send a blank email to php-general+get-32564@lists.php.net to get a copy of this message
I think this is what you want: <? if (is_array($recipients)) { foreach ($sendto as $to){ $list .= "$to\n"; } # foreach ($recipients as $to) { mail("$list","$subject"," From: $name Address: $address City/St/Zip: $city, $state $zip E-mail: $email $message _______________________________________________________ --Sent via a web form.\n\n","From: $name <$email>"); # } } ?> -----Original Message----- From: Jeremy [mailto:geektimes2@yahoo.com] Sent: Wednesday, January 03, 2001 4:28 PM To: php-general@lists.php.net Subject: Re: [PHP] Printing the output of a loop in an e-mail Hey, I think that I am the on that does not understand. The script is below. Mabye I am just misunderstanding where I need to put your code snippet. I have noted the place where I want the recipient list to go. I am fairly new at PHP so mabye I am just making a dumb mistake. <? if (is_array($recipients)) { foreach ($recipients as $to) { mail("$to","$subject"," From: $name Address: $address City/St/Zip: $city, $state $zip E-mail: $email $message _______________________________________________________ --Sent via a web form.\n\n","From: $name <$email>"); } } mail("$Name <$email>","Believers Against Child Killing Automailer - Confirmation"," The following is an exact copy of the e-mail(s) that you sent via our Automailer: From: $name Address: $address City/St/Zip: $city, $state $zip E-mail: $email $message _______________________________________________________ --Sent via a web form\n\n Your Message was sent to: I WOULD LIKE THE LIST OF RECIPIENTS TO BE INSERTED IN HERE! ","From: Believers Against Child Killing <backmail@backlife.org>"); ?> On Wed, 3 Jan 2001, Jeremy Bowen wrote: > Hey, > > I have a script that allows a user to send e-mails to multiple people using one > script. > > I want to output the contents of a loop that is used to pass the e-mail > addresses to the script in the confirmation e-mail that is sent to the user. > > My question is, how do i do this? I can't just stick the code in the mail() > function because it just prints the code in the e-mail and sends it. > > My loop looks like this: > > if (is_array($recipients)) { > > foreach ($recipients as $to) { > > echo "$to\n\n"; > > } > } > > and it works just fine. > > How do it print this loops output into the e-mail?? > > > Thanks, > Jeremy > $tolist=""; foreach (...) $tolist.="$to\n"; -- Ignacio Vazquez-Abrams <ignacio@openservices.net> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net ------------------------------------------------------- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#32564) next »