在Symfony2中使用Swiftmailer发送电子邮件

在Symfony2中使用Swiftmailer发送电子邮件,symfony,swiftmailer,Symfony,Swiftmailer,嗨,我正在使用Swiftmailer在我的项目symfony2中发送电子邮件作为联系方式。 当我在dev环境中尝试它时,它工作正常,但在prod中,我遇到了以下错误: Fatal error: Uncaught exception 'Swift_TransportException' with message ' in C:\wamp\www\saaytu_symfony\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\Ab

嗨,我正在使用Swiftmailer在我的项目symfony2中发送电子邮件作为联系方式。 当我在dev环境中尝试它时,它工作正常,但在prod中,我遇到了以下错误:

Fatal error: Uncaught exception 'Swift_TransportException' 
with message ' in C:\wamp\www\saaytu_symfony\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\AbstractSmtpTransport.php on line 386

Swift_TransportException: Expected response code 250 but got code "530", 
with message "530-5.5.1 Authentication Required. 
Learn more at 530 5.5.1 http://support.google.com/mail/bin/answer.py?answer=14257 lo18sm27016542wic.1 - gsmtp "
in C:\wamp\www\saaytu_symfony\vendor\swiftmailer\swiftmailer\lib\classes\Swift\Transport\AbstractSmtpTransport.php on line 386
请帮忙。 谢谢。

标记此项,然后:


您确定对dev/prod使用相同的PARAMETERS.YML吗?parameters.yml.中可能有不同的凭据。

看起来您没有在产品配置文件中配置SWIFT mailer,只是在开发配置文件中配置。您在哪里输入了邮件服务器的凭据?谢谢。我在config.yml中配置swift。它必须工作,因为config_prod.yml导入config.yml。我不知道为什么它不起作用。如果您可以发布配置的相关部分,只需排除敏感数据,这会很有帮助。您确定对dev/prod使用相同的PARAMETERS.YML吗?参数中可能有不同的凭据。ymlOk这很酷。参数是config_dev.yml,不在config.yml中。我刚刚把它复制到config_prod.yml.Ok,这是工作。我在config_dev.yml中有配置。我刚刚在conf_prod.yml中复制了它。很酷,谢谢你,everobody。