aspose file tools*
The moose likes Distributed Java and the fly likes caused by unrecognized ssl message plaintext connection? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "caused by unrecognized ssl message plaintext connection?" Watch "caused by unrecognized ssl message plaintext connection?" New topic

caused by unrecognized ssl message plaintext connection?

vinoth sathiya

Joined: Sep 20, 2011
Posts: 25

I am running Java Mail smtp configuration for my client with java mail api. it showing

javax.mail.SendFailedException : Sending Failed;
nested Exception is:
class javax.mail.MessagingException : Exception reading response;
nested Exception is:
" unrecognized ssl message, plaintext connection

my main code is :
//getting input from here for host,from,password,port and to address

props.put("", host);
props.put("mail.smtp.user", from);
props.put("mail.smtp.password", pword);
props.put("mail.smtp.port", port);
props.put("mail.smtp.ssl.enable", "true");
props.put("mail.smtp.auth", "true");
Session session = null;
props.put("mail.smtp.socketFactory.port", port);
props.put("mail.smtp.socketFactory.class", "");
props.put("mail.smtp.socketFactory.fallback", "false");
if(from != null && pword != null)
props.put("mail.smtp.auth", "true");
session = Session.getInstance(props, new MyPasswordAuthenticator(from, pword));
} else
session = Session.getDefaultInstance(props, null);
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress(from));
InternetAddress toAddress[] = new InternetAddress[to.length];
for(int i = 0; i < to.length; i++)
toAddress[i] = new InternetAddress(to[i]);

message.setRecipients(javax.mail.Message.RecipientType.TO, toAddress);
BodyPart bp1 = new MimeBodyPart();
Multipart multipart = new MimeMultipart();
bp1 = new MimeBodyPart();
javax.activation.DataSource source = new FileDataSource(ff);
bp1.setDataHandler(new DataHandler(source));
System.out.println((new StringBuilder("Sucessfully Sent to ")).append(toAddress).append("\n").toString());

How to resove it ?
it works in gmail smtp with this same code. but when i use client details(smtp address and port number) it showing above exception.
is there tool or program to check SSL ?

Thanks in advance
I agree. Here's the link:
subject: caused by unrecognized ssl message plaintext connection?
Similar Threads
Sending mail thru JAVA
Sending Email using Java gives error message
javax.mail.SendFailedException:Sending Failed; when i send other domain
how to send mail using gmail server
Sending file as an attachment