From 82140baa69ff88c329ad500224d6dfa605867536 Mon Sep 17 00:00:00 2001 From: kaiyou Date: Thu, 27 Sep 2018 07:52:43 +0200 Subject: [PATCH] Add a very simple test script for sending mails --- tests/smtp.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/smtp.py diff --git a/tests/smtp.py b/tests/smtp.py new file mode 100644 index 00000000..cfe09583 --- /dev/null +++ b/tests/smtp.py @@ -0,0 +1,17 @@ +import smtplib +import sys +from email import mime + +from email.mime.image import MIMEImage +from email.mime.multipart import MIMEMultipart + +msg = mime.multipart.MIMEMultipart() +msg['Subject'] = 'Test email' +msg['From'] = sys.argv[1] +msg['To'] = sys.argv[2] +msg.preamble = 'Test email' + +s = smtplib.SMTP('localhost') +s.set_debuglevel(1) +s.send_message(msg) +s.quit()