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

Grails 为什么不在生产服务器上发送电子邮件?,grails,Grails,我正在使用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:6

我正在使用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)
有人能帮我吗?为什么电子邮件不发送


谢谢


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

最后,在花了很多时间在这个问题上之后。我已经纠正了这个错误

实际上,问题就在设置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.
现在,检查您的应用程序以点击url,如“忘记密码”请求。您必须收到电子邮件。:)

你也可以阅读这篇文章。


谢谢

我在Config.groovy中检查了我的设置,我可以访问电子邮件地址。grails{mail{host=“smtp.gmail.com”端口=465用户名=”xxxxx@gmail.com“password=“xxxx”props=[“mail.smtp.auth”:“true”,“mail.smtp.socketFactory.port”:“465”,“mail.smtp.socketFactory.class”:“javax.net.ssl.SSLSocketFactory”,“mail.smtp.socketFactory.fallback:“false”]}尝试在道具中添加“mail.debug:“true”,这会很有帮助Mr.Cat我非常感谢您的帮助。这行代码“mail.debug:“true”“帮助我解决了这个问题。谢谢:)哦,我的天啊,老兄。。。在这个问题上花了将近2个小时,但找不到任何解决方案,你救了我一天。。那很有魅力。。非常感谢+1.