I am using Symfony + SwiftMailer and getting the following error from SwiftMailer:
500 |
Internal Server Error | Swift_TransportException
Expected response code 220 but got code "", with message ""
and can't figure out why. I am using hMailServer on my local machine, and have setup my factories.yml file (as I'm using Symfony) as follows:
mailer:
class: sfMailer
param:
logging: %SF_LOGGING_ENABLED%
charset: %SF_CHARSET%
delivery_strategy: realtime
transport:
class: Swift_SmtpTransport
param:
host: splodge.loc
port: 25
encryption: ~
username: ~
password: ~
I'm using the following code to send:
$message = $this->getMailer()->compose(
'
[email protected]',
'
[email protected]',
'Reset Password',
'Message'
);
$result = $this->getMailer()->send($message);
Has anyone had an issue like this before?
I have found that sometimes, and very randomly, the send goes through, but every other time, I get the above error message. So constantly refreshing the page that sends the mail, fails unpredictably, and as the code sometimes works, it's kinda hard to figure out what's wrong.
Any help will be highly appreciated!