1
0
Fork 0
mirror of https://github.com/Findus23/suntracking.git synced 2024-08-27 19:52:18 +02:00
suntracking/sendmail.py

16 lines
282 B
Python
Raw Normal View History

2018-05-18 21:59:06 +02:00
import smtplib
from email.mime.text import MIMEText
from config import by, to
2018-05-18 22:14:57 +02:00
def sendmail(subject, text):
msg = MIMEText(text)
2018-05-18 21:59:06 +02:00
2018-05-18 22:14:57 +02:00
msg['Subject'] = subject
2018-05-18 21:59:06 +02:00
msg['From'] = by
msg['To'] = to
s = smtplib.SMTP('localhost')
s.sendmail(by, [to], msg.as_string())