Phpmailer sending duplicate messages...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



It seems to be ccing each email to everyone and I'd like it to only include
one email address with each email.  I've tested in on three of my personal
emails and I see to get six messages in my inbox.

I'm also sending about 4000 emails and would like some pointers to avoid
time out errors.

Finally for the life of me can't figure out how to execute an insert
statement to record a history of each email sent.  When I include the insert
statement, no emails are send.

Following is the code.

Any help or direction would be greatly appreciated.

Thanks.

**************************


<?php

require("class.phpmailer.php");
$mail = new PHPMailer();

include ("cxnfile");  
	$cxn = mysqli_connect($host,$user,$password,$database)
         or die ("Couldn't connect to server");

$query =      "select *
		From db
		where groupid = groupid";

$result = mysqli_query($cxn,$query)
	or die("Couldn't execute select query.");
	
	while($row = mysqli_fetch_assoc($result))
	{
     extract($row);         

$mail->IsSMTP();
$mail->Host = "host.com"; 
$mail->From = "info@xxxxxxxx";

$mail->From = "info@xxxxxxxx";
$mail->FromName = "Company";
$mail->AddAddress("$email", "$Contact");

$mail->IsHTML(True);      
$mail->Subject = "$Subject";
$mail->Body = "$PR";
$mail->WordWrap = 50;



if(!$mail->Send())
{
   echo 'Message was not sent.';
   echo 'Mailer error: ' . $mail->ErrorInfo;
}
else
{
   echo 'Message has been sent.';
}

}

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux