2013-07-31 35 views
1

我正在使用grails插件“mail = 0.9”。电子邮件未在生产服务器上发送。它只适用于本地主机上的开发环境。为什么电子邮件不在生产服务器上发送?

错误在下面给出;

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) 

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

感谢

回答

5

最后,是在这个问题上花费太多的时间之后。我修复了这个错误。

其实这个问题正要设置Gmail帐户设置。 Google正在发送隐藏的验证码,这是显而易见的机器无法识别的。所以这就是我得到认证错误的原因。

解决方案: 我刚刚解锁了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

感谢

+0

非常感谢你...它为我工作。 :) –

0

javax.mail.AuthenticationFailedException
意味着你期运用不正确的凭据访问帐户,您使用发送电子邮件。

+0

我检查我的设置Config.groovy中,我可以访问的电子邮件地址。 的grails { 邮件{ 主机= “smtp.gmail.com” 端口= 465 用户名= “[email protected]” 密码= “XXXX” 道具= [ “mail.smtp.auth”:” true“, ”mail.smtp.socketFactory.port“:”465“, ”mail.smtp.socketFactory.class“:”javax.net.ssl.SSLSocketFactory“, ”mail.smtp.socketFactory.fallback“: “假”] }} –

+0

尝试添加“mail.debug”为:在道具“真”,这可以帮助 –

+0

我想这个和不同的方式。仍然有错误。 –

相关问题