Commit 8b33823b authored by Cristiano Urban's avatar Cristiano Urban
Browse files

Added simple mail test.

parent 35e390d0
Loading
Loading
Loading
Loading

tests/test_mail.py

0 → 100644
+20 −0
Original line number Diff line number Diff line
#!/usr/bin/python3

import smtplib

sender = 'noreply@domain.it'
receivers = ['cristiano.urban@inaf.it']

message = """From: From Person <from@fromdomain.com>
To: To Person <to@todomain.com>
Subject: SMTP e-mail test

This is a test e-mail message.
"""

try:
   smtpObj = smtplib.SMTP('relayhost', 25)
   smtpObj.sendmail(sender, receivers, message)
   print("Successfully sent email")
except SMTPException:
   print("Error: unable to send email")