Login   Register  
PHP Classes
elePHPant
Icontem

Bulk SMTP invalid recipent

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      MIME E-mail message sending  >  All threads  >  Bulk SMTP invalid recipent  >  (Un) Subscribe thread alerts  
Subject:Bulk SMTP invalid recipent
Summary:One false recipient cancel's the server connection
Messages:3
Author:Funnytowers
Date:2011-08-30 12:24:02
Update:2011-09-01 12:52:54
 

  1. Bulk SMTP invalid recipent   Reply   Report abuse  
Picture of Funnytowers
Funnytowers
2011-08-30 12:24:03
Hi and thanks for your class, very usefull.

I have a small problem when using the SMTP class and Bulk mail.

When there is one (single) invalid recipient then it cancels the rest of the messages that still need to be send.

for example,

$email_message->SetEncodedEmailHeader("To","good@addre.ss",$to_name);
$error=$email_message->Send();
$email_message->SetEncodedEmailHeader("To","good@addre.ss",$to_name);
$error=$email_message->Send();
$email_message->SetEncodedEmailHeader("To","BAD@addre.ss",$to_name);
$error=$email_message->Send();
$email_message->SetEncodedEmailHeader("To","good@addre.ss",$to_name);
$error=$email_message->Send();
$email_message->SetEncodedEmailHeader("To","good@addre.ss",$to_name);
$error=$email_message->Send();

The last 2 will not get send because the 3rd is invalid. I know this for sure because the "for($recipient" at the bottom part of the test_smtp_message.php only loops ONE invalid address while there are more.

Got any idea how to continue looping the bulk address list when there are invalid recipients listed?

Thanks,

Gabe

  2. Re: Bulk SMTP invalid recipent   Reply   Report abuse  
Picture of Manuel Lemos
Manuel Lemos
2011-08-31 05:06:48 - In reply to message 1 from Funnytowers
That's because once set the error, the class does not clear it. Just reset the error message yourself after the error:

$email_message->error = '';

  3. Re: Bulk SMTP invalid recipent   Reply   Report abuse  
Picture of Funnytowers
Funnytowers
2011-09-01 12:52:54 - In reply to message 1 from Funnytowers
Great it works !! Thanks alot!