I have a php script which requires phpmailer and I got it to work already but I need to send the email to 3000 persons. How do I do that? I've tried searching over the net but all the examples show only to enumerate the emails addresses. Mine comes from a database with queries. I have the following code :
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = 'ssl://smtp.gmail.com';
$mail->SMTPAuth = true;
$mail->SMTPKeepAlive = true;
$mail->Port = 465;
$mail->Username = "my@gmail.com";
$mail->Password = "password";
$mail->SetFrom('my@email.com', 'First Last');
$to = "my@gmail.com";
$mail->AddAddress('$to',"First Last");
$mail->Subject = "Test Mail";
$message = "messages go here";
$mail->MsgHTML($message);
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
}else{
echo "An e-mail was sent to $to with the subject: $subject";;}
Any suggestion is appreciated. Thanks!