Unrecognized Ssl Message Plaintext Connection Smtp



Ssl connection errorUnrecognized ssl message plaintext connection smtp server

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: 'javax.net.ssl.sslexception unrecognized ssl message, plaintext connection?' My main code is. Package com.techown.lib.mail; import java.io.UnsupportedEncodingException; import java.util.Properties; import javax.activation.DataHandler; import javax.activation. DavMail POP/IMAP/SMTP/Caldav to Exchange. SSLException Unrecognized SSL message, plaintext. SSLException Unrecognized SSL message, plaintext connection? Problem: I have a java complied package and it is sopposed to communicate with.sslexception: unrecognized ssl message, plaintext connection?

Message
Ranch Hand
posted 9 years agoSslexception unrecognized ssl message plaintext connection
Hi,
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:
'javax.net.ssl.sslexception unrecognized ssl message, plaintext connection
?'
my main code is :
//getting input from here for host,from,password,port and to address
props.put('mail.smtp.host', 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', 'javax.net.ssl.SSLSocketFactory');
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);
message.setSubject(subject);
BodyPart bp1 = new MimeBodyPart();
Multipart multipart = new MimeMultipart();
bp1.setText(messageBody);
multipart.addBodyPart(bp1);
bp1 = new MimeBodyPart();
javax.activation.DataSource source = new FileDataSource(ff);
bp1.setDataHandler(new DataHandler(source));
bp1.setFileName(fileName);
multipart.addBodyPart(bp1);
message.setContent(multipart);
Transport.send(message);
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

Unrecognized Ssl Message Plaintext Connection Javamail Smtp

Connection

Smtp Ssl Or Tls

Problem while sending message: javax.mail.MessagingException:
hi.. i'm a newbie in Kettle.. I want to e-mail 2 xls file to a certain e-mail address through a Job.. but I always encounter the following error message...
Problem while sending message: javax.mail.MessagingException: Exception reading response;
nested exception is:
javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
I have this following settings:
servername: smtp.gmail.com
port: 587
secure connection : TLS
can you give me a solution to this problem.. or a working example will do. thanks in advance..
mhiL