Finalizado modulo de alertas. Testeado clase ExploringTask a fondo.

This commit is contained in:
pablomartincalvo 2018-09-09 19:22:21 +02:00
parent 5eedb037ed
commit 7a795d1fb8
2 changed files with 30 additions and 48 deletions

View file

@ -2,38 +2,26 @@ from email.mime.multipart import MIMEMultipart
from email.mime.text import MIMEText
import smtplib
my_adress = 'drogonalerts@gmail.com'
my_address = 'drogonalerts@gmail.com'
master_address = 'pablomartincalvo@gmail.com'
def alert_master(header, message):
#TODO Acabar la alerta de email
msg = MIMEMultipart()
message = "Thank you"
password = "noesfacilvivirsindrogon"
msg['From'] = my_address
msg['To'] = master_address
msg['Subject'] = header
# setup the parameters of the message
password = "your_password"
msg['From'] = "your_address"
msg['To'] = "to_address"
msg['Subject'] = "Subscription"
# add in the message body
msg.attach(MIMEText(message, 'plain'))
# create server
server = smtplib.SMTP('smtp.gmail.com: 587')
server.starttls()
# Login Credentials for sending the mail
server.login(msg['From'], password)
# send the message via the server.
server.sendmail(msg['From'], msg['To'], msg.as_string())
server.quit()
print
"successfully sent email to %s:" % (msg['To'])