在服务器上配置gmail时邮件服务器连接失败,但在本地计算机

时间:2017-04-05 16:56:06

标签: email ssl grails groovy grails-plugin

  

错误:   org.springframework.mail.MailSendException:邮件服务器连接失败;嵌套异常是javax.mail.MessagingException:无法连接到SMTP主机:smtp.gmail.com,port:465;嵌套异常是:java.net.SocketException:java.security.NoSuchAlgorithmException:构造实现时出错(算法:默认,提供者:SunJSSE,类:sun.security.ssl.SSLContextImpl $ DefaultSSLContext)。消息失败:javax.mail.MessagingException:无法连接到SMTP主机:smtp.gmail.com,port:465;嵌套异常是:java.net.SocketException:java.security.NoSuchAlgorithmException:构造实现时出错(算法:默认,提供者:SunJSSE,类:sun.security.ssl.SSLContextImpl $ DefaultSSLContext);消息异常详细信息(1)是:失败消息1:javax.mail.MessagingException:无法连接到SMTP主机:smtp.gmail.com,port:465;嵌套异常是:java.net.SocketException:java.security.NoSuchAlgorithmException:在com.sun.mail.smtp.SMTPTransport构造实现(算法:默认,提供者:SunJSSE,类:sun.security.ssl.SSLContextImpl $ DefaultSSLContext)时出错.openServer(SMTPTransport.java:1986)位于grails.plugin.mail的javax.mail.Service.connect(Service.java:345)的com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:656)。 MailMessageBuilder.sendMessage(MailMessageBuilder.groovy:131)at grails.plugin.mail.MailService.sendMail(MailService.groovy:55)at grails.plugin.mail.MailService.sendMail(MailService.groovy:59)at grails.plugin.springsecurity .ui.strategy.MailPluginMailStrategy.sendMail(MailPluginMailStrategy.groovy:50)at grails.plugin.springsecurity.ui.strategy.MailPluginMailStrategy.sendVerifyRegistrationMail(MailPluginMailStrategy.groovy:34)at grails.plugin.springsecurity.ui.RegisterController.sendVerifyRegistrationMail(RegisterController) .groovy:79)注册ER

config.groovy

mail {
   host = "smtp.gmail.com"
   port = 465
   username = "*******@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"]
}

0 个答案:

没有答案