Re: Printing the output of a loop in an e-mail
| From: | Jeremy | Date: | Wed, 03 Jan 2001 23:27:51 +0000 |
| Subject: | Re: Printing the output of a loop in an e-mail | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-32561@lists.php.net to get a copy of this message | ||
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
-------------------------------------------------------