# Import smtplib to provide email functions
import smtplib
 
# Import the email modules
from email.mime.text import MIMEText
 
# Define email addresses to use
addr_to   = 'user1@example.com'
addr_from = 'patrice.delpy@free.fr'
 
# Define SMTP email server details
smtp_server = 'smtp.free.fr'
smtp_user   = 'patrice.delpy'
smtp_pass   = '0ghumsaz'
 
# Construct email
msg = MIMEText('This is a test email')
msg['To'] = addr_to
msg['From'] = addr_from
msg['Subject'] = 'Test Email From RPi'
 
# Send the message via an SMTP server
s = smtplib.SMTP(smtp_server)
s.login(smtp_user,smtp_pass)
s.sendmail(addr_from, addr_to, msg.as_string())
s.quit()
