This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes JavaMail imap connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "JavaMail imap connection" Watch "JavaMail imap connection" New topic

JavaMail imap connection

Gerenne Vives
Ranch Hand

Joined: Feb 05, 2005
Posts: 60
Hi all,

I'm try connect at Exchange Server 2010 with Javamail for to read messages, but when try connect appear the following error:

Unrecognized SSL message, plaintext connection?
javax.mail.MessagingException: Unrecognized SSL message, plaintext connection?;
nested exception is: Unrecognized SSL message, plaintext connection?
at com.sun.mail.imap.IMAPStore.protocolConnect(
at javax.mail.Service.connect(
at javax.mail.Service.connect(
at conseritmailbatch.ConseritMailBatch.main(
Caused by: Unrecognized SSL message, plaintext connection?
at com.sun.mail.util.SocketFetcher.configureSSLSocket(
at com.sun.mail.util.SocketFetcher.createSocket(
at com.sun.mail.util.SocketFetcher.getSocket(
at com.sun.mail.iap.Protocol.<init>(
at com.sun.mail.imap.protocol.IMAPProtocol.<init>(
at com.sun.mail.imap.IMAPStore.protocolConnect(

My properties:


My code:

Session sesion = Session.getDefaultInstance(properties);
Store store=sesion.getStore("imap");
store.connect("X.X.X.X","", "1234");

In the line "store.connect("X.X.X.X","", "1234")" throws the exception.

Thanks in advance.

I agree. Here's the link:
subject: JavaMail imap connection
Similar Threads
IMAP /TLS standalone programm works fine, in Tomcat fails.
unknown host exception error
Problem using Java Mail API
JavaMail and security
Unrecognized SSL message, plain text connection