我正在尝试将电子邮件发送到另一个电子邮件地址..
如果我使用此代码作为我的电子邮件服务器,我的代码运行良好。
grails {
mail{
// teravin smtp setting
host = "smtp.gmail.com"
port = 465
username = "myname@gmail.com"
password = "ping123456"
props = ["mail.smtp.auth":"true",
"mail.smtp.socketFactory.port":"465",
"mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory",
"mail.smtp.starttls.enable": "true",
"mail.smtp.socketFactory.fallback":"false"]
}
}
但我试图像这样使用Gmail For Work
grails {
mail{
// teravin smtp setting
host = "smtp.gmail.com"
port = 465
username = "myname@mydomain.com" //here i am using a domain. like dwayne@alibaba.com
password = "ping123456"
props = ["mail.smtp.auth":"true",
"mail.smtp.socketFactory.port":"465",
"mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory",
"mail.smtp.starttls.enable": "true",
"mail.smtp.socketFactory.fallback":"false"]
}
}
然后我得到这样的错误..
534-5.7.14 <https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt=AKgnsbu7
A
534-5.7.14 Armc1Kv6BMKJgBgDa5JMjBolFfZ-IxR1po773uTSasXpJcLSemxn58swxGL_3zIOhnNVF
N
534-5.7.14 5g0y20MA6FFEVrE_xzqcpS3SooMYLpr2_WWtgnNBSZi4Ycnq1SrGv-rqZ50fnOA8GPLdp
I
534-5.7.14 15howBb6bqYod_AsiKgjkfKGXK1z1F_0u79m3UmYfQXAjnai49pMz5GZkvp6oDYxEClM3
x
534-5.7.14 1CmWME6Jbkph6tVkdGd-yjlHow9c> Please log in via your web browser and
534-5.7.14 then try again.
534-5.7.14 Learn more at
534 5.7.14 https://support.google.com/mail/answer/78754 f21sm1805436pfd.6 - gsm
tp
. Stacktrace follows:
Message: 534-5.7.14 <https://accounts.google.com/ContinueSignIn?sarp=1&scc=1&plt
=AKgnsbu7A
534-5.7.14 Armc1Kv6BMKJgBgDa5JMjBolFfZ-IxR1po773uTSasXpJcLSemxn58swxGL_3zIOhnNVF
N
534-5.7.14 5g0y20MA6FFEVrE_xzqcpS3SooMYLpr2_WWtgnNBSZi4Ycnq1SrGv-rqZ50fnOA8GPLdp
I
534-5.7.14 15howBb6bqYod_AsiKgjkfKGXK1z1F_0u79m3UmYfQXAjnai49pMz5GZkvp6oDYxEClM3
x
534-5.7.14 1CmWME6Jbkph6tVkdGd-yjlHow9c> Please log in via your web browser and
534-5.7.14 then try again.
534-5.7.14 Learn more at
534 5.7.14 https://support.google.com/mail/answer/78754 f21sm1805436pfd.6 - gsm
tp
我想知道为什么我会收到此错误...这是因为我还在使用试用帐户吗?
答案 0 :(得分:1)
解决方案的具体线索在于错误消息,
https://support.google.com/mail/answer/78754
尝试按照&#34;疑难解答&#34;在那里。
之前我遇到过这个问题,并使用该页面中提到的其中一个步骤解决了这个问题:
从Gmail的网络版登录您的帐户 https://mail.google.com。登录后,请尝试登录 邮件应用程序。
访问http://www.google.com/accounts/DisplayUnlockCaptcha并登录 使用您的Gmail用户名和密码。如果询问,请输入字母 扭曲的画面。