2013-07-31 33 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

我想這個和不同的方式。仍然有錯誤。 –

相關問題