2016-10-15 88 views

回答

0

在谷歌“帐户设置”使能“少安全的应用程序访问”设置为“允许”。

邮寄主机是您的localhost或127.0.0.1。

+0

感谢您的回复。允许“Access for less secured apps”和mailer_host:127.0.0.1也是如此 – user6827096

0

我使用这个配置我的本地应用程序

parameters: 
    mailer_transport: gmail 
    mailer_host: smtp.gmail.com 
    mailer_user: [email protected] //replace by your gmail account 
    mailer_password: ********** //replace by your gmail password 

config.yml: 
    swiftmailer: 
    transport: "%mailer_transport%" 
    host:  "%mailer_host%" 
    username: "%mailer_user%" 
    password: "%mailer_password%" 
    spool:  { type: memory } 

控制器代码似乎是我的一样这不是smtp.google.com。

正如napestershine在他的回应中所说的,不要忘记在你的Gmail账户上允许安全性较低的应用程序。

相关问题