05-08-2005, 01:46 AM
|
#15 (permalink)
|
|
The Wanderer
Join Date: May 2005
Posts: 5
Thanks: 0
|
Very good example. However, just for constructive criticism, I would do this instead:
PHP Code:
$emails = array("email1@aol.com","email2@aol.com","email3@aol.com");
$subject = "Hello";
$body = "Message Here";
$headers = "From: Billy";
foreach($emails as $e) {
if(!mail($e,$subject,$body,$from)) {
die("Error in sending mail);
}
}
This way, if you do choose to send it to many people, spam blockers won't interpret the huge mailing list as a spam email. You can also use the last argument in many different ways other than "From". Based on the smtp protocol, you can do much more with it. see http://php.net/mail for more information.
|
|
|