Commit 69505fbf authored by Sacha's avatar Sacha
Browse files

send_mail now includes ts

parent f684b249
from config import SMTP_BOT_SENDER, SMTP_BOT_SENDER_PW, ADMIN_EMAIL, APP_NAME
import smtplib
from email.mime.text import MIMEText
from datetime import datetime
import pytz
SMTP_SERVER = 'smtp.2pitau.org'
SMTP_PORT = 587
def send_mail(subj, body):
midwest = pytz.timezone('America/Chicago')
date = datetime.now(midwest)
msg = MIMEText('''%s
(you're receiving this from a 2PITAU mailbot.
Forward this message---and provide your address---to
postmaster@2pitau.org to unsubscribe.)''' % body)
timestamp: %s in Chicago
(you're receiving this from a 2PITAU mailbot. Forward this message to postmaster@2pitau.org to unsubscribe.)''' %
(body, datetime.strftime(date, '%a, %d %B %Y, %H:%M')))
msg['Subject'] = '[%s] %s' % (APP_NAME, subj)
msg['From'] = SMTP_BOT_SENDER
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment