grails:无法连接到SMTP主机:*********,port:25

时间:2016-09-20 09:38:01

标签: java email grails

任何人都可以帮助我,我无法从我的应用发送电子邮件并遇到以下错误。

日志:

Session_End

这是我的grails配置:

Could not connect to SMTP host: ****.******.** port: 25;

nested exception is:

javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?. Failed messages: javax.mail.MessagingException: Could not connect to SMTP host: smtp.webbfontaine.ci, port: 25;
  nested exception is:

javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?; message exception details (1) are:
Failed message 1:
javax.mail.MessagingException: 
Could not connect to SMTP host: ****.******.**, port: 25;
  nested exception is:


javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?

at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1986)

at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:656)

at javax.mail.Service.connect(Service.java:345)

at org.springframework.mail.javamail.JavaMailSenderImpl.connectTransport(JavaMailSenderImpl.java:486)

at org.springframework.mail.javamail.JavaMailSenderImpl.doSend(JavaMailSenderImpl.java:406)

at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:345)

at org.springframework.mail.javamail.JavaMailSenderImpl.send(JavaMailSenderImpl.java:340)

构建COnfig:

 grails{
        mail {
            disabled = false
            host = "*****.****.**"
            port = 25
            username = "account"
            password=""
            props = ["mail.smtp.auth":"false",
                     "mail.smtp.socketFactory.port":"25"]
        }
    }

希望得到你的慷慨帮助。

由于

2 个答案:

答案 0 :(得分:0)

错误消息还指向SSL连接。好像您正在尝试使用标准SMTP TCP连接到SSL端口。这是一个Stack Over流,它有一个类似的错误信息。

unrecognized ssl message plaintext connection exception

答案 1 :(得分:0)

确保使用正确的SSL端口号。默认情况下,SSL / TLS加密的SMTP使用端口465.