2016-04-03 20:03:58 +00:00
|
|
|
import smtplib
|
|
|
|
import email.mime.text
|
|
|
|
from szurubooru import config
|
|
|
|
|
2016-08-14 12:22:53 +00:00
|
|
|
|
2016-04-03 20:03:58 +00:00
|
|
|
def send_mail(sender, recipient, subject, body):
|
|
|
|
msg = email.mime.text.MIMEText(body)
|
|
|
|
msg['Subject'] = subject
|
|
|
|
msg['From'] = sender
|
|
|
|
msg['To'] = recipient
|
|
|
|
|
|
|
|
smtp = smtplib.SMTP(
|
|
|
|
config.config['smtp']['host'], int(config.config['smtp']['port']))
|
|
|
|
smtp.login(config.config['smtp']['user'], config.config['smtp']['pass'])
|
|
|
|
smtp.send_message(msg)
|
|
|
|
smtp.quit()
|