1 Reply Latest reply: Aug 22, 2013 1:10 PM by Bill Shannon-Oracle RSS

    Upgrading to JavaMail 1.5 gives issues when using plain text

    user1080568

      Hi All,

       

      I need to upgrade to java mail version 1.5 from 1.4.4. Am facing issues to send mail from an SSL enabled mailbox. Below is the stacktrace of the issue. With Javamail 1.4.4 and with SSL the program works fine, it also works fine without SSL on Javamail 1.5.

      Has anyone faced similar issue? Can you suggest any workaround/solution for the same ?

       

      Error occurred javax.mail.MessagingException: Could not connect to SMTP host: XX.XX.XX.XX, port: 587;nested exception is:

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

      javax.mail.MessagingException: Could not connect to SMTP host: XX.XX.XX.XX, port: 587;nested exception is:

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

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

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

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

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

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

              at test.SMTPTest.main(SMTPTest.java:57)

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

              at sun.security.ssl.InputRecord.handleUnknownRecord(InputRecord.java:671)

              at sun.security.ssl.InputRecord.read(InputRecord.java:504)

              at sun.security.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:927)

              at sun.security.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1312)

              at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1339)

              at sun.security.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1323)

              at com.sun.mail.util.SocketFetcher.configureSSLSocket(SocketFetcher.java:528)

              at com.sun.mail.util.SocketFetcher.createSocket(SocketFetcher.java:333)

              at com.sun.mail.util.SocketFetcher.getSocket(SocketFetcher.java:229)

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

              ... 5 more