I've got a simple SMTP mailing example from here and my modified it. My code is:
import smtplib
sender = 'igor.savinkin@gmail.com'
receivers = ['igor.savinkin@gmail.com']
message = """From: From Igor <igor.savinkin@gmail.com>
To: To Igor Savinkin <igor.savinkin@gmail.com>
Subject: SMTP e-mail test
This is a test e-mail message from SMTP python.
"""
try:
smtpObj = smtplib.SMTP('localhost')
smtpObj.sendmail(sender, receivers, message)
print "Successfully sent email to " + receivers.__str__()
except SMTPException:
print "Error: unable to send email"
Output is:
Successfully sent email to ['igor.savinkin@gmail.com']
Yet, in actuality I find no mails like these in my inbox. The spam folder is checked too! What's wrong? I use rhc (OpenShift) platform.