Unknown
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user