Created
June 17, 2022 04:35
-
-
Save akosijose/b6ca5d584535764286183c9dcd4dcca0 to your computer and use it in GitHub Desktop.
python using smtplib outlook
This file contains hidden or 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
# final sender mail | |
import smtplib | |
def send_email(subject, body): | |
server = smtplib.SMTP(host='smtp-mail.outlook.com', port=587) | |
server.ehlo() | |
server.starttls() | |
server.login('[email protected]', 'Sm@rtd00rb3ll@345*') | |
message = f'Subject: {subject}\n\n{body}' | |
server.sendmail('[email protected]', '[email protected]', message) | |
server.quit() | |
send_email("haha", "hakdog") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment