简体   繁体   中英

Javax mail api with OVH

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.

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

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");

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM