0
try:
    print("Creating email server connection")
    server = smtplib.SMTP("mail.privateemail.com", 587)
    server.starttls(context=context)
    server.login(fromaddr, email_password)
except Exception as e:
    print("Exception raised when starting email server:", str(e))
    quit()

The above code is throwing the following error:

Exception raised when starting email server: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)

The other scripts used to send emails, installed on the same server, work fine. Somehow the exception appears in this script only.

Hatim
  • 417
  • 6
  • 8
  • 1
    Does this answer your question? [ssl.SSLError: \[SSL: CERTIFICATE\_VERIFY\_FAILED\] certificate verify failed (\_ssl.c:852)](https://stackoverflow.com/questions/56534407/ssl-sslerror-ssl-certificate-verify-failed-certificate-verify-failed-ssl-c) – metatoaster Jul 06 '20 at 08:16
  • No, tried it, but still same problem – Hatim Jul 06 '20 at 08:25

0 Answers0