2016-10-15 87 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賬戶上允許安全性較低的應用程序。

相關問題