Search code examples
pythonemailsmtpsmtplib

Can't establish connection with the OVH's SMTP


from smtplib import SMTP
SMTP("SSL0.OVH.NET", 465)

SMTPServerDisconnected: Connection unexpectedly closed

Hum, this error message is frustrating, I have no clues of what I can do !


Solution

  • from smtplib import SMTP
    SMTP("SSL0.OVH.NET", 587)
    

    I don't know why but this work. OVH should be 993 to send to and 465 to send from but it works better with 587 which should work to send from gmail.