Last active
September 3, 2022 14:23
-
-
Save samirsaci/e079a737e03ac2d3d4f29dce647766d4 to your computer and use it in GitHub Desktop.
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
| # Message Object | |
| msg = MIMEMultipart() | |
| msg['Subject'] = 'Workload Report for {}'.format(WEEK) | |
| msg['From'] = from_mail | |
| msg['To'] = ', '.join([from_mail, to_mail]) | |
| msg.preamble = 'Workload Report for {}'.format(WEEK) | |
| # Attach the HTML code | |
| msg.attach(MIMEText(html_string, 'html', 'utf-8')) | |
| # Send the email via our own SMTP server | |
| server = smtplib.SMTP_SSL(smtp_server, smtp_port) | |
| server.ehlo() | |
| server.login(from_mail, from_password) | |
| server.sendmail(from_mail, [from_mail, to_mail], msg.as_string()) | |
| server.quit() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment