import smtplib from email.mime.text import MIMEText msg = MIMEText('Hello, this is message body') msg['Subject'] = 'Hello' msg['From'] = 'belstudent@yandex.ru' msg['To'] = 'petrov@petrov.ru' s = smtplib.SMTP() s.connect('http://smtp.myhost.com') # соединяемся с SMTP сервером s.login('login','password') # авторизуемся s.sendmail('belstudent@yandex.ru', ['petrov@petrov.ru'], msg.as_string()) s.quit()
Leave a Reply
You must be logged in to post a comment.
Свежие комментарии