SwiftMailer is the default way of sending email from a Symfony 2 project, and I'd like to use it in an application. I've pointed it towards the SMTP server provided by my internet provider (Virgin Media, in the UK), but my emails are not successfully sent. The exception thrown says
Expected response code 250 but got code "501", with message "501 HELO requires valid address
in response to the SMTP command
HELO [::1]
[::1] corresponds to localhost in IPv6, and it's not that surprising that the SMTP server would reject that if it's expecting a proper domain name. Tracing execution through the Swiftmailer source, I find that this value comes from _domain on AbstractSmtpTransport; altering the value during the debug session allows the email to be sent. Although it can be set using the public setLocalDomain() method, it isn't anywhere in the Symfony 2 framework, so it seems that there is no way (obvious to me, at least) of easily configuring this value simply by, for example, changing a Symfony config file.
So my question is this: is there some other way of changing this value, ideally using config, without my diving into the Symfony code and changing bits that aren't meant to be changed? And if so, what?