Not all recipients receive the email
Hi,
I use universal email to send emails from our intranet to my colleagues from a number of different applications. Almost every script sends some pdf document of excel list generated by some other php class.
Some scripts are executed by cronjobs, some scripts are executed by the user.
The mails are processed using the smtp method and the host is spf.filtermail.eu (our ISP gives us this host address)
Now the issue, the script below is an example of a script that is executed by cronjob. Every Monday morning at 09:00 this script send an email to a few colleagues. The problem, not all will receive the email. If I manually execute the cronjob at a different time, they all receive the email.
I checked my cronjob list and noticed at 09:00 in the morning more tasks are executed at the same time. I am almost sure the issue is because several tasks are run at the same time. Now I have changed the execution time of the cronjobs, so no script will run at he same time (if it is executed by the cronjob)
Still, I have no influence when a user is executing an email script manually using the intranet browser. And when this happens, the issue occurs too. Not always the email is received by the user.
As I look at my server workload in never peaks of something like that.
I do see in the email error log SMTP connect() failed. It is so strange some do receive the email, and some do not.
My question, is there a way to be sure the email is send? Or is there another solution for this issue?
Thank in advance.
Cheers,
Michel
if (true) { //WA Universal Email
$Email = new WA_Email("mail_2");
$Email->From = "test@example.com";
$Email->CharSet = "UTF-8";
$Email->Method = "smtp";
$Email->Host = "spf.filtermail.eu";
$Email->Port = "587";
$Email->SMTPAuth = false;
$Email->addTo("address1@example.com");
$Email->addTo("address2@example.com");
$Email->addTo("address3@example.com");
$Email->addTo("address4@example.com");
$Email->BodyFile = "../webassist/email/templates/WebAssist-Block/references.php";
if (function_exists("rel2abs") && $Email->Redirect) $Email->Redirect = $Email->Redirect?rel2abs($Email->Redirect,dirname(__FILE__)):"";
for ($emailGroup=0; $emailGroup<sizeof($Email->To); $emailGroup++) {
$Email->Subject = "Reminder";
$Email->send($emailGroup);
}
$Email->close();
}