i have created a simple project for sending emails from swiftmailer, however, messages are delivered from console but not from Controller. My code is
$message = \Swift_Message::newInstance('hello','test message', 'text/plain','Cp1252')
->setFrom('service@mycompany.com')->setTo('myuser@mycompany.com');
$this->get('mailer')->send($message);
i tried with symfony 2.7 and symfony 3.0 with swiftmailer 5.4, and with encoding utf-8 and Cp1252
the error message on dev.log is app.ERROR: Exception occurred while flushing email queue: Expected response code 250 but got code "501", with message "501 5.5.4 Invalid Address " [] []
when i send emails from console this works without problem.
Thanks in advance.
为了解决我没有http:// localhost而是运行网络http:// hostname的情况下运行脚本,但是,我不知道如何在开发环境中正确运行
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.