Grails Send Mail无效

时间:2013-07-09 12:16:24

标签: grails ssl grails-plugin grails-2.0

我正在使用Mail Plugin在我的Grails应用程序中发送电子邮件。我这样做......

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"]

} }

和控制器---

class MailController {
  def mailService

  def sendmail = {
mailService.sendMail {     
    to "example@gmail.com"     
    subject "Hello Fred"     
    body 'How are you?' 
  }
  }

当我尝试发送邮件时。它抛出错误

 URI
   /groovypublish/mail/sendmail
 Class
   sun.security.provider.certpath.SunCertPathBuilderException
 Message
   unable to find valid certification path to requested target

如果我从config.groovy中删除邮件道具部分。然后发送邮件后,我的页面无限次加载。

我使用localhost:8080发送邮件。我知道SSL存在问题。但是我如何避免SSL部分。

请帮忙......

1 个答案:

答案 0 :(得分:0)

我有同样的问题。进入我的病毒扫描程序设置并关闭出站邮件扫描解决了这个问题。