我有一个使用Symfony 2.8框架和FosUserBundle插件的应用程序。在dev
环境中,注册确认邮件可以发送成功,但在prod
环境中却不能发送。没有日志消息,smtp配置也是正确的。
相关版本信息:
- Symfony版本:2.8.1
- Swiftmailer-bundle版本:当前版本(与Symfony兼容,Composer json中为
2.*
) - Fosuserbundle版本:1.3.5(Composer中标记为
*
)
dev
环境配置如下:
imports:
- { resource: config.yml }
framework:
router:
resource: "%kernel.root_dir%/config/routing_dev.yml"
#strict_requirements: true
profiler: { only_exceptions: true }
web_profiler:
toolbar: true
intercept_redirects: true
assetic:
use_controller: true
有其他人也遇到过同样的问题吗?
编辑
我刚刚尝试使用以下终端命令在prod
环境中发送邮件:php sf --env=prod swiftmailer:email:send
终端输出:
#!/usr/bin/env php
From: test@antondachauer.de
To: mail@antondachauer.de
Subject: test
Body: test
Sent 1 emails
但是邮件没有发送。在dev
环境中,在终端中也可以工作。
config*.yml
文件中的swiftmailer
配置是什么?它使用spool吗?它如何与FOSUserBundle链接?所有电子邮件都不发送还是只有来自FOSUserBundle的电子邮件不发送? - A.Lapp/logs/prod.log
可能会有所帮助。 - qwertz