-1
Good morning!
I have an email marketing system and I am having problems when performing a newsletter shot to a large contact list. (Understand large list as: a list containing over 1000 emails).
If I fire the shot for less than 1000 emails, the shot goes off perfectly. If there are more than 1000, it does not send to everyone, getting to send up to only half of the list.
I contacted Localweb, the server that hosts my accounts and where I authenticate SMTP, and they informed me that it may be a possible packet loss while sending.
My code searches the database (SQL Server) within a loop for all the emails from the list that was selected for shooting and then sends. One consideration: sending is done by a Cron Job that runs every 5 minutes.
Can anyone help me? Any idea what it might be?
My shipping code:
$mail = new PHPMailer();
$mail->setLanguage('br');
$mail->CharSet='utf-8';
$mail->IsSMTP();
$mail->Host = "xxx";
$mail->SMTPAuth = true;
$mail->Username = 'xxx';
$mail->Password = 'xxx';
$mail->SMTPSecure = 'tls';
$mail->Port = 587;
$mail->From = $email; (variável que vem do banco de dados)
$mail->FromName = $fantasia; (variável que vem do banco de dados)
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
for($z=0; $z<count($bcc); $z++){
if($html == '1'){
$topo = recebe um código html específico;
$rodape = recebe um código html específico;
$texto2 = recebe um código html específico, concatenando as variáveis $topo e $rodape - newsletter que será enviada;
}else{
if($topo == '1'){
$topo = recebe um código html específico;
$rodape = recebe um código html específico;
}else{
$topo = recebe um código html específico;
$rodape = recebe um código html específico;
}
$texto2 = recebe o código html específico, concatenando $topo e $rodape - newsletter que será enviada;
}
$mail->AddAddress($bcc[$z]['Email']);
$mail->IsHTML(true);
$mail->Subject = $tit; (variável vinda do banco)
$mail->Body = $texto2;
$mail->AltBody = $texto2;
$enviado = $mail->Send();
$mail->ClearAllRecipients();
$mail->ClearAttachments();
}
Do you know anything about this "packet loss" or if Phpmailer has a limit? Because it just skips a few emails and sends them to others.
– Raabe Sampaio
Does he return any mistakes? Here is a link from the Phpmailer github about sending to lists: https://github.com/PHPMailer/PHPMailer/wiki/Sending-to-lists
– Eduardo Abreu dos Santos
No... No error :( It simply does not send... And as I said up there, if I have a list for 9,000 contacts, sometimes it can go as high as 4,000. I saw about this doc of Phpmailer and I follow these instructions for optimization, but I do not know what can be happening :(
– Raabe Sampaio
A doubt, it’s skipping shipping or to at a certain time?
– Eduardo Abreu dos Santos
He skips shipments, some he shoots like that jumping and other points on the list, 50/100 emails in a row, he doesn’t even shoot anymore. It makes sense?
– Raabe Sampaio