This commit is contained in:
Scott Idem
2022-12-01 18:03:54 -05:00
parent 1b18bdbfb6
commit 6e51cd0305
2 changed files with 5 additions and 1 deletions

View File

@@ -403,8 +403,11 @@ def send_email(
log.info('SMTP configuration, connect, and send')
try:
with smtplib.SMTP_SSL(settings.SMTP['server_name'], settings.SMTP['server_port'], context=context) as server:
with smtplib.SMTP_SSL(settings.SMTP['server'], settings.SMTP['port'], context=context) as server:
log.setLevel(logging.DEBUG) # DEBUG, INFO, WARNING, ERROR, EXCEPTION, CRITICAL
log.debug('SMTP log in...')
server.login(settings.SMTP['username'], settings.SMTP['password'])
log.debug('SMTP send message...')
server.send_message(message)
log.info('Email sent')
return True