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

15 lines
282 B
Python

import smtplib
from email.mime.text import MIMEText
from config import by, to
def sendmail(subject, text):
msg = MIMEText(text)
msg['Subject'] = subject
msg['From'] = by
msg['To'] = to
s = smtplib.SMTP('localhost')
s.sendmail(by, [to], msg.as_string())