mirror of
https://github.com/Llloooggg/Jarvis.git
synced 2026-03-06 03:56:23 +03:00
Merge branch 'master' of https://github.com/Llloooggg/Jarvis
This commit is contained in:
20
actions.py
20
actions.py
@@ -5,16 +5,22 @@ from flask_login import current_user
|
||||
import telegram
|
||||
|
||||
|
||||
def send_mail():
|
||||
mail_sender = '' #отправитель
|
||||
mail_receiver = '' #адресат
|
||||
username = '' #имя пользователя
|
||||
password = '' #пароль от почты
|
||||
#Ответ на письмо
|
||||
#формат строки (логин#пароль#адресат#текст)
|
||||
#send_mail_config='login@gmail.com#Password123#myfriend@gmail.com#Текст сообщения'
|
||||
|
||||
def send_mail(send_mail_config):
|
||||
|
||||
send_mail_list=send_mail_config.split('#')
|
||||
mail_sender = send_mail_list[0] #отправитель
|
||||
mail_receiver = send_mail_list[2] #адресат
|
||||
username = send_mail_list[0] #имя пользователя
|
||||
password = send_mail_list[1] #пароль от почты
|
||||
server = smtplib.SMTP('smtp.gmail.com:587')
|
||||
|
||||
# Формируем тело письма
|
||||
subject = u'Тестовый email от '
|
||||
body = u'Отправка письма на Питтоне '
|
||||
subject = u'J.a.r.v.i.s.'
|
||||
body = send_mail_list[3]
|
||||
msg = MIMEText(body, 'plain', 'utf-8')
|
||||
msg['Subject'] = Header(subject, 'utf-8')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user