Php Can';不使用Symfony应用程序发送电子邮件,但控制台工作正常

Php Can';不使用Symfony应用程序发送电子邮件,但控制台工作正常,php,symfony,smtp,swiftmailer,mail-server,Php,Symfony,Smtp,Swiftmailer,Mail Server,我面前有一个老项目。应用程序生成的电子邮件不会到达。但如果我使用下面的命令,他们就会到达 php bin/console swiftmailer:email:send -vvv --from=example@example.org --to=example@example.org --subject=mailTest --body=testSMTP --env=prod 控制台和应用程序应使用相同的参数 mailer_transport: smtp mailer_host: MY

我面前有一个老项目。应用程序生成的电子邮件不会到达。但如果我使用下面的命令,他们就会到达

php bin/console swiftmailer:email:send -vvv --from=example@example.org --to=example@example.org --subject=mailTest --body=testSMTP --env=prod
控制台和应用程序应使用相同的参数

mailer_transport:  smtp
mailer_host:       MYSUBDOMAIN.MYHOSTER.net
mailer_port:       587
mailer_user:       myexample@exampleemail.org
mailer_password:   password
mailer_auth_mode:  login
mailer_encryption: ssl
应用程序是使用Symfony 3.1.4和Swiftmailer 2.3开发的

你能给我一个建议吗


谢谢。

您确定使用相同的环境吗?您使用的命令是swift mailer bundle,但您没有提到您的应用程序中用于发送电子邮件的任何代码。你能提供更多细节吗?谢谢可以将应用程序发送的邮件配置为在队列中等待发送。例如,需要一个cron作业来定期调用console命令。对于某些prod环境,甚至建议不要通过发送邮件来阻止应用程序/php脚本。