Disable swiftmailer spool in Symfony per environment

心已入冬 提交于 2019-12-05 00:52:36

Apparently the only way to disable email spooling is to completely leave out the spool entry from your configuration file. Once you include the spool entry in the main configuration file, there is no way to disable spooling for a specific environment.

That said, you can accomplish the opposite of what you propose: you can disable email spooling by default and enable it in specific environments.

Leave it out in config.yml:

swiftmailer:
    transport: %mailer_transport%
    host:      %mailer_host%
    port:      %mailer_port%
    username:  %mailer_user%
    password:  %mailer_password%

And include it in config_prod.yml:

swiftmailer:
    spool:     %mailer_spool_type%
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!