Page 1 of 1

issue with beta 4

Posted: Mon Feb 02, 2009 9:26 am
by ddh
In my news letter application, I just updated Swift to version 4. But sending a basic email gives me the following error:

Code: Select all

Fatal error: Uncaught exception 'Swift_Transport_TransportException' with message 'Expected response code 250 but got code "550", 
with message "550 Access denied - Invalid HELO name (See RFC2821 4.1.1.1) "' in /home/accountname/public_html/manager/Swift-4.0.0-b4/lib/classes/Swift/Transport/AbstractSmtpTransport.php:395 
Stack trace: #0 /home/accountname/public_html/manager/Swift-4.0.0-b4/lib/classes/Swift/Transport/AbstractSmtpTransport.php(279): Swift_Transport_AbstractSmtpTransport->_assertResponseCode('550 Access deni...', Array) 
#1 /home/accountname/public_html/manager/Swift-4.0.0-b4/lib/classes/Swift/Transport/AbstractSmtpTransport.php(304): Swift_Transport_AbstractSmtpTransport->executeCommand('MAIL FROM: <mai...', Array) 
#2 /home/accountname/public_html/manager/Swift-4.0.0-b4/lib/classes/Swift/Transport/AbstractSmtpTransport.php(430): Swift_Transport_AbstractSmtpTransport->_doMailFromCommand('mailer@domain...') 
#3 /home/accountname/public_html/manager/Swift-4.0.0-b4/lib/classes/Swift/Transport/AbstractSmtpTransport.php(462): Sw in /home/accountname/public_html/manager/Swift-4.0.0-b4/lib/classes/Swift/Transport/AbstractSmtpTransport.php on line 395
This is the code I used to generate the email:

Code: Select all

//Sendmail
$transport = Swift_SendmailTransport::newInstance('/usr/sbin/sendmail -bs');
 
//Create the Mailer using your created Transport
$mailer = Swift_Mailer::newInstance($transport);
 
//Create a message
$message = Swift_Message::newInstance('A basic message', 'just testing')
  ->setTo(array('daviddh@domain.nl' => 'Test: Testing'))
  ->setFrom(array('mailer@sendingdomain.nl' => 'Myself'))
  ;
 
Could anyone give me any pointers as how to solve the "Invalid HELO name"? The account mailer@sendingdomain.nl (or the real address I place there) exists on the server.

Thanks a lot!

David

Re: issue with beta 4

Posted: Mon Feb 02, 2009 9:49 pm
by Chris Corbyn
No compliant SMTP server should discriminate based on your HELO name, but anyway.

Code: Select all

$transport = Swift_SendmailTransport::newInstance('/usr/sbin/sendmail -bs');
$transport->setLocalDomain('sendingdomain.nl');
 
// .. rest of code ...
In the meantime I'll try to determine why the default didn't work. Maybe I've forgotten to actually pass it! ;)

Re: issue with beta 4

Posted: Tue Feb 03, 2009 2:53 am
by ddh
Thank you Chris!

With "setLocalDomain" it works like a charm.

Cheers, David

Re: issue with beta 4

Posted: Tue Feb 03, 2009 7:52 am
by Chris Corbyn
This is now fixed in the repository and will be included in the next release. For anybody having difficulty you just need a call to setLocalDomain() as shown above. This applies to both SmtpTransport and SendmailTransport.