/shoe-maker.py Secret
Created
October 21, 2023 17:28
shoe-maker: simple email sending
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
... | |
FILES_PATHS=["dir/containing/image","image2"] | |
try: | |
with smtplib.SMTP('smtp.gmail.com', 587) as smtp: | |
smtp.starttls() | |
smtp.ehlo() | |
smtp.login(GMAIL_ADDR, APP_PASSWORD) | |
subject = 'Testing plain text email' | |
body = 'Testing plain text body' | |
msg = f'Subject: {subject}\n\n{body}' | |
smtp.sendmail(fromaddr=GMAIL_ADDR, to_addrs=GMAIL_ADDR, msg=msg) | |
print('Sent successfully!') | |
except Exception as e: | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment