Commit ad080b5c authored by Samy Haffoudhi's avatar Samy Haffoudhi

envoie mail simple

parent aefc3bb3
import os
import smtplib
from email.message import EmailMessage
EMAIL_ADDRESS = os.environ.get('EMAIL_USER')
EMAIL_PASSWORD = os.environ.get('EMAIL_PASS')
msg = EmailMessage()
msg['Subject'] = 'Test subject'
msg['From'] = EMAIL_ADDRESS
msg['To'] = 'haffoudhisamy@gmail.com'
msg.set_content('test content')
with smtplib.SMTP_SSL('smtp.gmail.com', 465) as smtp:
smtp.login(EMAIL_ADDRESS, EMAIL_PASSWORD)
smtp.send_message(msg)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment