Page 1 of 1

Need help deciphering SwiftMailer Log

Posted: Tue Jul 22, 2008 2:51 pm
by mark.martin
I'm trying to implement SwiftMailer on my website to send automated emails to subscribers. I'm currently doing some very basic testing, but not having much success and need help deciphering the $log messages.

In my test, I'm trying to send an email to three different addresses. The first two fail to send. The third is successfully sent, but I don't receive the email. Below is my source code along with the SwiftMail log. I don't know much about how Internet/SMTP mail works and I need help deciphering the SwiftMail log. Also, note that the email addresses in my code have been changed to protect the innocent. My real test script uses actual working email addresses. :-)

First, here's my source code...

Code: Select all

 
$swift = new Swift(new Swift_Connection_SMTP($smtp_host, $smtp_port));
 
$log = Swift_LogContainer::getLog();
$log->setLogLevel(4);
 
$fromAddr = "subscriptions@mydomain.com";
$fromName = "Subscriptions";
$swiftFromAddress = new Swift_Address($fromAddr, $fromName);
 
$subject = "Test Swift EMail";
$body = "This is a test of the SwiftMailer class library.";
$swiftMessage = new Swift_message($subject, $body);
 
$swiftRecipients = new Swift_RecipientList();
$swiftRecipients->addTo("address1@domain1.com");
$swiftRecipients->addTo("address2@domain2.com");
$swiftRecipients->addTo("address3@domain3.com");
$number_sent = $swift->send($swiftMessage, $swiftRecipients, $swiftFromAddress);
 
print("Sent " . $number_sent . " messages.<br><br>");
 
$log->dump();
 
Here's what I get...
Sent 1 messages.

++ Log level changed to 4
>> MAIL FROM: <subscriptions@mydomain.com>
<< 250 OK

>> RCPT TO: <address1@domain1.com>
<< 550-([74.220.200.137]) [74.220.200.137] is currently not permitted to relay
550-through this server. Perhaps you have not logged into the pop/imap server
550-in the last 30 minutes or do not have SMTP Authentication turned on in your
550 email client.
!! Expected response code(s) [250] but got response [550-([74.220.200.137]) [74.220.200.137] is currently not permitted to relay
550-through this server. Perhaps you have not logged into the pop/imap server
550-in the last 30 minutes or do not have SMTP Authentication turned on in your
550 email client.]
!! Recipient 'address1@domain1.com' rejected by connection.

>> RCPT TO: <address2@domain2.com>
<< 550-([74.220.200.137]) [74.220.200.137] is currently not permitted to relay
550-through this server. Perhaps you have not logged into the pop/imap server
550-in the last 30 minutes or do not have SMTP Authentication turned on in your
550 email client.
!! Expected response code(s) [250] but got response [550-([74.220.200.137]) [74.220.200.137] is currently not permitted to relay
550-through this server. Perhaps you have not logged into the pop/imap server
550-in the last 30 minutes or do not have SMTP Authentication turned on in your
550 email client.]
!! Recipient 'address2@domain2.com' rejected by connection.

>> RCPT TO: <address3@domain3.com>
<< 250 Accepted
>> DATA
<< 354 Enter message, ending with "." on a line by itself
>> <MESSAGE DATA>
>>
.
<< 250 OK id=1KLNTK-0005nM-Vc
++ Message sent to 1/3 recipients