diff options
| author | Christian Cleberg <[email protected]> | 2025-06-20 13:55:54 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2025-06-20 13:55:54 -0500 |
| commit | 785f42901f34aaf356f316c691e3f56138c8608d (patch) | |
| tree | 5b8f7a6e33a6af410e511137fdd51b6fa60d0f83 /utils.py | |
| download | aws-summary-report-785f42901f34aaf356f316c691e3f56138c8608d.tar.gz aws-summary-report-785f42901f34aaf356f316c691e3f56138c8608d.tar.bz2 aws-summary-report-785f42901f34aaf356f316c691e3f56138c8608d.zip | |
initial commit
Diffstat (limited to 'utils.py')
| -rw-r--r-- | utils.py | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/utils.py b/utils.py new file mode 100644 index 0000000..4d14fe0 --- /dev/null +++ b/utils.py @@ -0,0 +1,15 @@ +import smtplib +from email.message import EmailMessage + + +def send_email(smtp_config, subject, body, recipients): + msg = EmailMessage() + msg.set_content(body) + msg["Subject"] = subject + msg["From"] = smtp_config["sender"] + msg["To"] = ", ".join(recipients) + + with smtplib.SMTP(smtp_config["smtp_server"], smtp_config["smtp_port"]) as server: + server.starttls() + server.login(smtp_config["smtp_username"], smtp_config["smtp_password"]) + server.send_message(msg) |
