Loading src/common/mail.py +3 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ def send_email(subject, text): """ logger = create_logger() from_address = ce('EMAIL_SENDER') smtp_address = ce('SMTP_ADDRESS', 'smtp.ornl.gov') smtp_port = ce('SMTP_PORT', 25) if from_address is None: logger.critical('Unable to send email as no EMAIL_SENDER set') return None Loading @@ -36,7 +38,7 @@ def send_email(subject, text): msg.attach(MIMEText(text, 'plain')) logger.info(f'Sending email to {to_address} from {from_address}') try: with smtplib.SMTP('smtp.ornl.gov', 25) as server: with smtplib.SMTP(smtp_address, smtp_port) as server: server.set_debuglevel(ce('EMAIL_DEBUG_LEVEL', 0)) server.send_message(msg) server.quit() Loading Loading
src/common/mail.py +3 −1 Original line number Diff line number Diff line Loading @@ -19,6 +19,8 @@ def send_email(subject, text): """ logger = create_logger() from_address = ce('EMAIL_SENDER') smtp_address = ce('SMTP_ADDRESS', 'smtp.ornl.gov') smtp_port = ce('SMTP_PORT', 25) if from_address is None: logger.critical('Unable to send email as no EMAIL_SENDER set') return None Loading @@ -36,7 +38,7 @@ def send_email(subject, text): msg.attach(MIMEText(text, 'plain')) logger.info(f'Sending email to {to_address} from {from_address}') try: with smtplib.SMTP('smtp.ornl.gov', 25) as server: with smtplib.SMTP(smtp_address, smtp_port) as server: server.set_debuglevel(ce('EMAIL_DEBUG_LEVEL', 0)) server.send_message(msg) server.quit() Loading