Symfony Send email in production environment

Deadly 提交于 2019-12-06 16:34:20

I've used my Gmail account to send emails in Symfony2, and I specify some parameters which you have not specified. Below is my configuration:

config.yml:

swiftmailer:
    transport: %mailer_transport%
    encryption: %mailer_encryption%
    auth_mode:  %mailer_auth_mode%
    host:      %mailer_host%
    username:  %mailer_username%
    password:  %mailer_password%
    spool:     { type: memory }

parameters.yml:

mailer_transport:  smtp
mailer_encryption: ssl
mailer_auth_mode:  login
mailer_host:       smtp.gmail.com
mailer_username: myusername@gmail.com
mailer_password: mypassword

Related with your second question, the original line is

$kernel = new AppKernel('prod', false);

If you change this to true, error messages can be showed in production mode, because the second parameter of the AppKernel construct indicates the debug mode.

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