繁体   English   中英

Swiftmailer不会在Symfony Controller上刷新电子邮件

[英]Swiftmailer not flush emails on Symfony Controller

我创建了一个简单的项目,用于从swiftmailer发送电子邮件,但是,消息是从控制台传递的,而不是从Controller传递的。 我的代码是

$message = \Swift_Message::newInstance('hello','test message', 'text/plain','Cp1252')
    ->setFrom('service@mycompany.com')->setTo('myuser@mycompany.com');
    $this->get('mailer')->send($message);
  • 的PHP是5.6
  • SMTP服务器是IIS 6
  • 从xampp安装Apache
  • 所以是Windows Server 2008

我尝试过使用swiftmailer 5.4的symfony 2.7和symfony 3.0,并使用utf-8和Cp1252编码

dev.log上的错误消息为app.ERROR:刷新电子邮件队列时发生异常:预期响应代码为250,但代码为“ 501”,消息为“ 501 5.5.4无效地址” [] []

当我从控制台发送电子邮件时,这没有问题。

提前致谢。

为了解决我没有http:// localhost而是运行网络http:// hostname的情况下运行脚本,但是,我不知道如何在开发环境中正确运行

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM