Symfony2,发送邮件到 gmail [英] Symfony2, send mail to gmail

查看:39
本文介绍了Symfony2,发送邮件到 gmail的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想拦截 Symfony2 发送的所有电子邮件.

I want to intercept all email send by Symfony2.

我是这样配置 swiftmailer 的:

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

我没有收到电子邮件.我正在 Windows10 上开发,我使用 Wamp.

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

推荐答案

我猜你是在开发模式下,所以你需要在你的 config_dev 文件中这样做:

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

这篇关于Symfony2,发送邮件到 gmail的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆