#!/usr/bin/python
print "Content-type: text/html\n\n"
# -*- coding:Utf-8 -*-

import smtplib

sender = 'patrice.delpy@free.fr'
receivers = ['patrice.delpy@free.fr']

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('localhost')
   smtpObj.sendmail(sender, receivers, message)         
   print("Successfully sent email")
except SMTPException:
   print("Error: unable to send email")
