how do I send same mail to multiple recipiants? help me?
mail to more than one email addresses
I agree with Piranha. But to get you on the right track, here is one I use.
//open the port
$fp = fsockopen(localhost, 25, $errno, $errstr, 30);
$email_dbname = "database_name";
mysql_select_db ($email_dbname, $conn) or die (mysql_error());
//Select users and send emails one at a time
$query = "SELECT EmailAddress, FirstName, LastName FROM email_list WHERE requested='1'";
$getrow = mysql_query($query, $conn) or die(mysql_error());
while($row = mysql_fetch_array($getrow)) {
$EmailAddress = $row['EmailAddress'];
$FirstName = $row['FirstName'];
$LastName = $row['LastName'];
echo 'Sending emails to -->'.$FirstName.' '.$LastName.' '.'at '.$EmailAddress.'<br>';
//Send email to them
$message = '<html><head></head><body>All your HTML info goes here!</body></html>';
$header = 'MIME-Version: 1.0' . "\r\n";
$header .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$header .= "From: admin@whereever.com\r\n";
$subject = $emails_subject;
$email_to = $EmailAddress;
mail($email_to, $subject ,$message ,$header) ;
}
fclose($fp); // close fp port
echo '<br>All the "emails have been sent!!!';
That will do it, of course, after you change the vanilla table info to your table info.
Good luck,
Don
I would check out this mail class > http://www.gerd-tentler.de/tools/mimemail/
someone suggested it to me and it works perfect, i use it in all my mail scripts now