class Mail(object): EMAIL_ADRESS = 'my_mail' EMAIL_PASSWORD = 'my_password' EMAIL_RESIVER = 'resiver@gmail.com' def __init__(self, message_content): self.msg = EmailMessage() self.msg['Subject'] = '===> subject <===' self.msg['From'] = Mail.EMAIL_ADRESS self.msg['To'] = Mail.EMAIL_RESIVER self.msg.set_content(message_content) with smtplib.SMTP_SSL('smtp.gmail.com', 465) as smtp: smtp.login(Mail.EMAIL_ADRESS, Mail.EMAIL_PASSWORD) smtp.send_message(self.msg) При включении VPN эта часть скрипта не работает. Без VPN всё отлично.
Обсуждают сегодня