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.