问题描述
DEBUG:getProvider()returningjavax.mail.Provider[TRANSPORT,smtp,com.sun.mail.smtp.SMTPTransport,Oracle]DEBUGSMTP:useEhlotrue,useAuthtrueDEBUGSMTP:tryingtoconnecttohost"mail.testin.cn",port587,isSSLfalsejavax.mail.MessagingException:CouldnotconnecttoSMTPhost:mail.testin.cn,port:587;nestedexceptionis:javax.net.ssl.SSLException:UnrecognizedSSLmessage,plaintextconnection?atcom.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1961)atcom.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:654)atjavax.mail.Service.connect(Service.java:295)atjavax.mail.Service.connect(Service.java:176)atnis.com.util.SendMail.sendMessage(SendMail.java:64)atnis.com.util.SendMail.main(SendMail.java:71)Causedby:javax.net.ssl.SSLException:UnrecognizedSSLmessage,plaintextconnection?atsun.security.ssl.InputRecord.handleUnknownRecord(InputRecord.java:671)atsun.security.ssl.InputRecord.read(InputRecord.java:504)atsun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:927)atsun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312)atsun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1339)atsun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1323)atcom.sun.mail.util.SocketFetcher.configureSSLSocket(SocketFetcher.java:549)atcom.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:354)atcom.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:211)atcom.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1927)...5more用公司的邮箱发送邮件时报这些错误
解决方案
解决方案二:
显然是连接不通。。。
解决方案三:
解决方案四:
仔细看报错了啊