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
|
||||
|
||||
@@ -704,6 +704,7 @@ def email_user_auth_key_url(
|
||||
<p>Thank you!</p>
|
||||
"""
|
||||
|
||||
log.info('Trying send_email()...')
|
||||
if send_email(from_email=from_email, from_name=from_name, to_email=to_email, to_name=to_name, bcc_email=bcc_email, bcc_name=bcc_name, subject=subject, body_text=None, body_html=body_html):
|
||||
log.info(f'An email with a one time use sign in link was sent to {to_email}.')
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user