Created
January 22, 2020 10:13
-
-
Save anir0y/be6d613dd3d793e54f3e6d2be1dd0f65 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
import smtplib | |
usr = "login@domain.com" | |
password = "password" | |
sender = 'you@domain.com' | |
receivers = ['person@domain.com'] #this needs to be a list | |
message = """From: From Person <you@domain.com> | |
To: To Person <to@todomain.com> | |
Subject: SMTP e-mail test | |
This is a test e-mail message. | |
""" | |
server = smtplib.SMTP('smtp.office365.com', 587) #this is the SMTP for a Microsoft 365 account | |
server.starttls() | |
server.login(usr,password) | |
server.sendmail(sender, receivers, message) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment