Commit bba3c5db authored by Huihui, Jonathan's avatar Huihui, Jonathan
Browse files

fix variable

parent a22f10c6
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -73,8 +73,7 @@ def send_email(subject, text, files=None, recipients=None):
            logger.error(f'Failed to attach file {files}. {files} is not a '
                         'file.')
    else:
        logger.error(f'Failed to attach files "{files}". Please ensure that '
                     '"files" is passed as type "list"')
        logger.info(f"No files attached: \"{files}\" ")
    logger.info(f'Sending email to {to_address} from {from_address}')
    # try:
    if all(var is None for var in [relay_address, relay_port,
@@ -85,7 +84,7 @@ def send_email(subject, text, files=None, recipients=None):
            server.quit()
        logger.info(f'Email successfully sent to {to_address}.')
    elif all(var is not None for var in [relay_address, relay_port,
                                         relay_address]):
                                         relay_password]):
        # allow ssl connection
        context = ssl.create_default_context()
        with smtplib.SMTP(relay_address, relay_port) as conn: