php - Configure SwiftMailer "Local Domain" setting easily, in Symfony 2 -
swiftmailer default way of sending email symfony 2 project, , i'd use in application. i've pointed towards smtp server provided internet provider (virgin media, in uk), emails not sent. exception thrown says
expected response code 250 got code "501", message "501 helo requires valid address
in response smtp command
helo [::1]
[::1] corresponds localhost in ipv6, , it's not surprising smtp server reject if it's expecting proper domain name. tracing execution through swiftmailer source, find value comes _domain on abstractsmtptransport; altering value during debug session allows email sent. although can set using public setlocaldomain() method, isn't anywhere in symfony 2 framework, seems there no way (obvious me, @ least) of configuring value by, example, changing symfony config file.
so question this: there other way of changing value, ideally using config, without diving symfony code , changing bits aren't meant changed? , if so, what?
unfortunately no.
the code local domain in swiftmailer is:
/** try determine hostname of server run on */ private function _lookuphostname() { if (!empty($_server['server_name']) && $this->_isfqdn($_server['server_name'])) { $this->_domain = $_server['server_name']; } elseif (!empty($_server['server_addr'])) { $this->_domain = sprintf('[%s]', $_server['server_addr']); } }
so, guessed , it's server configuration.
i opened issue swiftmailer this:
Comments
Post a Comment