问题
I am using Mail Plugin to send email in my grails application. I am doing like this ...
Config.groovy ----
grails {
mail {
host = "smtp.gmail.com"
port = 465
username = "example@gmail.com"
password = "*********"
props = ["mail.smtp.auth":"true",
"mail.smtp.socketFactory.port":"465",
"mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory",
"mail.smtp.socketFactory.fallback":"false"]
} }
and Controller ---
class MailController {
def mailService
def sendmail = {
mailService.sendMail {
to "example@gmail.com"
subject "Hello Fred"
body 'How are you?'
}
}
When I am trying to send mail. It throwing ERROR
URI
/groovypublish/mail/sendmail
Class
sun.security.provider.certpath.SunCertPathBuilderException
Message
unable to find valid certification path to requested target
If I remove mail props part from my config.groovy. Then After send mail, my page loaded infinite times.
I am using localhost:8080 to send mail. I know problem is in SSL. But How can I avoid SSL part.
Please help ...
回答1:
I had the same issue. Going into my virus scanner's settings and turning off outbound mail scanning solved the issue.
来源:https://stackoverflow.com/questions/17547949/grails-send-mail-is-not-working