There´s another post about this, over 3 months old, but there they are dealing with port settings which isn´t the problem, so I´m making a new thread.
I send out 50+ emails in a loop via PHPMailer - SMTP.
For testing purposes I send them all to myself, so I can verify receiving them.
I guess I don´t have to post the code, it´s a loop, it does 50+ times the exact same thing with the same SMTP username and password, the same receiver, the same content and most times I receive 50+ mails, all correct, so my code is definately fine, the SMTP server is fine, I´m not exceeding any limits or anything.
Anyway, here it is:
$path = $_SERVER["DOCUMENT_ROOT"]."phpmailer/";
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
for($i = 0; $i < 60; $i++)
{
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "..."; // SMTP address
$mail->SMTPAuth = true;
$mail->Username = "..."; // my SMTP username
$mail->Password = "..."; // my SMTP password
$mail->From = "..."; // my mail address
$mail->FromName = "..."; // my name
$mail->AddAddress("..."); // my mail address
$mail->AddReplyTo("...", "..."); // my mail address and name
$mail->CharSet="utf-8";
$mail->WordWrap = 50;
$mail->IsHTML(true);
$mail->Subject = "Some Title";
$mail->Body = "Some<br>HTML<br>text";
$mail->AltBody = "Some normal text";
$mail->Send();
}
Once in a while something goes wrong and I get
Warning: fputs() expects parameter 1 to be resource, integer given in
... /PHPMailer/class.smtp.php on line 215
I´ve checked, parameter 1 is the SMTP password.
If neccessary I can add, I have the latest version of PHPMailer, my Provider has PHP5.
But even if the version was not the latest, if 9 out of 10 times all goes fine and the 10th time still 35 or so emails go through without problems, why would then suddenly the password not be correct upon the 36th and again be correct upon the 37th?