Open Lvl4Sword opened 6 years ago
I am not sure - the only thing I am relying on is using the right port and using SMTP_SSL from smtplib. I think you cannot tweak much yourself (as this also targets gmail first of all), but it should use encrypted communication with gmail when using smtp_ssl=True
(the default).
With python 3.10 launching, the need to change context rises up(since default context is much more strict, so you need to change it)
With python 3.10 launching, the need to change context rises up(since default context is much more strict, so you need to change it)
Do you have a code example for it?
import ssl
import smtplib
port = 465
smtp_server = ** # server
login = ** # your login generated by Mailtrap
password = ** # your password generated by Mailtrap
ctx = ssl.create_default_context()
ctx.set_ciphers('ALL:@SECLEVEL=2')
s = smtplib.SMTP_SSL(smtp_server, port, context=ctx)
s.login(login, password)
This is a smtplib
example, the reason to require a new context is that a lot of mail server doesn't have a very secure cipher that python 3.10 requires
I had completely forgotten about this issue, which was from 3 years ago..
I normally will just use something like prep_mail and mail_this from my LockMsg script -- https://github.com/Lvl4Sword/LockMsg/ -- if I need e-mail in Python. Either that or Sendgrid, Mailchimp, etc.
Going through the docs, I didn't notice anything to do with SSL Context.
Are any of these set anywhere?