From fb3652a954e5f5c889faf8a84fb307474bcfe46b Mon Sep 17 00:00:00 2001 From: SpudGunMan Date: Mon, 9 Dec 2024 17:51:03 -0800 Subject: [PATCH] Update smtp.py --- modules/smtp.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/smtp.py b/modules/smtp.py index f8da802..7136e51 100644 --- a/modules/smtp.py +++ b/modules/smtp.py @@ -35,7 +35,7 @@ def send_email(to_email, message, nodeID=0): if nodeID in bbs_ban_list: logger.warning("System: Email blocked for " + nodeID) return "⛔️Email throttled, try again later" - + # Send email try: # Create message msg = MIMEMultipart() @@ -46,7 +46,8 @@ def send_email(to_email, message, nodeID=0): # Connect to SMTP server server = smtplib.SMTP(SMTP_SERVER, SMTP_PORT, timeout=SMTP_TIMEOUT) - server.starttls() + if SMTP_PORT != 25: + server.starttls() server.login(SMTP_USERNAME, SMTP_PASSWORD) # Send email; this command will hold the program until the email is sent