Last active
December 18, 2015 01:29
-
-
Save madssj/5704552 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def send_plain_mail(subject, body, from_mail, to): | |
import smtplib | |
from email.MIMEText import MIMEText | |
from email.Encoders import encode_quopri | |
msg = MIMEText(body, 'plain', 'iso-8859-1') | |
msg['Subject'] = subject | |
msg['From'] = from_mail | |
msg['To'] = to | |
s = smtplib.SMTP() | |
s.connect() | |
s.sendmail(from_mail, [to], msg.as_string()) | |
s.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment