Javax mail api with OVH

2.3k views Asked by At

Is it possible to user javax mail with OVH? I can do it with Yahoo mail, but when I am trying to use it with OVH I am getting this error :

at org.springframeworkjavax.mail.MessagingException: Exception reading response; nested exception is: java.net.SocketException: Connection reset

the connection properties are :

properties.put("mail.smtp.starttls.enable", "true");
properties.put("mail.smtp.host", host);
properties.put("mail.smtp.user", from);
properties.put("mail.smtp.password", pass);
properties.put("mail.smtp.port", "465");
properties.put("mail.smtp.auth", "true");
properties.put("mail.imap.ssl.enable", "true");

If anyone can see where I am wrong here...

Thanks.

2

There are 2 answers

0
brclz On

I tried successfully by using the TLD port 587 (as indicated by @Mo.Ashfaq above).

The documentation from OVH is visible here: http://help.ovh.com/EmailConfiguration

0
Andrés Cuadros On

This config works for me:

properties.put("mail.smtp.host", "ssl0.ovh.net");
properties.put("mail.smtp.user", user);
properties.put("mail.smtp.password", pass);
properties.put("mail.smtp.port", "587");
properties.put("mail.smtp.auth", "true");
properties.put("mail.smtp.starttls.enable", "true");