Sending mail with SSL with Python 2.3
-
15-02-2021 - |
Question
I'm working with Python 2.3 and I need to send e-mails with SSL.
According to the docs, SMTP_SSL was added in Python 2.6.
Is there a way to use SSL also in Python 2.3 (maybe with a third-party module)?
Solution
Maybe you can just use starttls()
just like:
smtp = smtplib.SMTP(mailhost)
smtp.starttls()
In SMTP_SSL doc you can find:
SMTP_SSL should be used for situations where SSL is required from the beginning of the connection and using starttls() is not appropriate.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow