Page 1 of 1
PHP mail()
Posted: Tue Nov 28, 2006 7:21 am
by thiscatis
Hi,
I'm trying to send a mail to multiple recipients.
I'm querying the database for all the recipients addresses (about 50).
But I can't figure out the PHP code to format the query results (a bunch of emails) in the right form for to add
into the
variable.
So the email will be send to all the addresses.
Anyone?
Posted: Tue Nov 28, 2006 7:59 am
by feyd
Are you trying to build a email system yourself, as an educational experience or are you just needing to send the emails? For the latter, I'd suggest using
Swift.
For the former, if memory serves, only one recipient can be listed in the normal "to" argument. Others must be added through the "additional headers" argument.
Posted: Tue Nov 28, 2006 9:10 am
by thiscatis
feyd wrote:Are you trying to build a email system yourself, as an educational experience or are you just needing to send the emails? For the latter, I'd suggest using
Swift.
For the former, if memory serves, only one recipient can be listed in the normal "to" argument. Others must be added through the "additional headers" argument.
-It's for educational experience.
- So this won't work?
Code: Select all
$to = 'mail1@gmail.com' . ', ';
$to .= 'mail2@gmail.com';
?
Posted: Tue Nov 28, 2006 9:17 am
by jayshields
It should do, but if not, there are alternatives, that have already been mentioned, that can be found in the PHP manaul.