【发布时间】:2017-01-24 15:44:20
【问题描述】:
我正在使用 Grails 2.5.1 和 mail:1.0.7 插件发送电子邮件,但是当我使用它时,我总是收到以下错误:
Class:javax.mail.AuthenticationFailedExceptionMessage:535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8 https://support.google.com/mail/answer/14257 qq4sm4579366wjc.14 - gsmtp
虽然我可以使用提供的凭据从浏览器成功登录!!
这是我在 Config 文件中的配置:
grails {
mail {
host = "smtp.gmail.com"
port =465
username = "****"
password = "***"
props = ["mail.smtp.auth":"true",
"mail.smtp.socketFactory.port":"465",
"mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory",
"mail.smtp.socketFactory.fallback":"false"]
}
}
这是行动:
mailService.sendMail{
to userInstance.toEmail
subject userInstance.subject
html "<strong>Test</strong> "
}
我缺少什么?
【问题讨论】:
标签: grails grails-plugin