Symfony2, send mail to gmail

我与影子孤独终老i 提交于 2020-01-16 04:50:11

问题


I want to intercept all email send by Symfony2.

I configure swiftmailer like that:

swiftmailer:
    delivery_address: my@gmail.com #My gmail addr
    transport: gmail
    username:  my@gmail.com#I use my gmail for easy smtp configuration (just for dev)
    password:  mypassword

I receive no emails. I'm developping on Windows10 and i use Wamp.


回答1:


I guess you in dev mode, so you need to do this in you config_dev file:

# app/config/config_dev.yml
swiftmailer:
    disable_delivery: false
    delivery_address:  dev@example.com



回答2:


I guess you put your conf in config.yml file. You have to check in config_prod and config_dev if the "delevery_address" param is not overidden.



来源:https://stackoverflow.com/questions/32121424/symfony2-send-mail-to-gmail

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