为什么电子邮件不在生产服务器上发送?

时间:2013-07-31 11:09:46

标签: grails

我正在使用grails插件“mail = 0.9”。电子邮件不在生产服务器上发送。它只适用于localhost上的开发环境。

错误如下;

Stacktrace follows: 
javax.mail.AuthenticationFailedException
        at javax.mail.Service.connect(Service.java:319)
        at org.grails.mail.MailService.sendMail(MailService.groovy:63)
        at org.grails.mail.MailService.sendMail(MailService.groovy:46)
        at org.grails.mail.MailService$sendMail.call(Unknown Source)
        at MailGrailsPlugin$_configureSendMail_closure4.doCall(MailGrailsPlugin.groovy:86)
        at com.tkxel.chefvivant.api.SommelierController$_closure4.doCall(SommelierController.groovy:107)
        at com.tkxel.chefvivant.api.SommelierController$_closure4.doCall(SommelierController.groovy)
        at java.lang.Thread.run(Thread.java:636)

任何人都可以帮助我吗?为什么电子邮件没有发送?

由于

2 个答案:

答案 0 :(得分:5)

最后,在这个问题上花了很多时间。我修复了这个错误。

实际上问题是要设置Gmail帐户设置。谷歌正在发送隐藏的验证码,而明显的机器无法识别它。这就是我收到身份验证错误的原因。

<强>解决方案: 我刚刚解锁了Gmail验证码,现在它运行正常。

Steps to reproduce this

1. Logout your gmail account first.
2. Visit this url https://accounts.google.com/DisplayUnlockCaptcha and then put username and password to login
3. Press "Continue" button to unlock the captcha
4. It will automatically save the settings.

现在,检查您的应用程序是否像“忘记密码”请求一样点击网址。您必须收到电子邮件。 :)

您还可以阅读这篇文章。 http://productforums.google.com/forum/#!topic/gmail/uBdBQAuGeTw

由于

答案 1 :(得分:0)

javax.mail.AuthenticationFailedException
表示您使用不正确的凭据访问用于发送电子邮件的帐户。