def METHOD_NAME(From, To, msg, login={}, dryrun=False):
    """Send an email"""
    if dryrun:
        out = "\n****************************\n"
        out += "* DRYRUN: not sending mail *\n"
        out += "****************************\n"
        out += "Receivers: {}\n".format(To)
        out += "Message:\n"
        out += msg
        logger.info(out)
        return
    if login is None:
        login = {}
    # TODO: default_login has been added to fix issues with old auto_nag
    # so need to remove that stuff once old auto_nag will have been removed.
    default_login = utils.get_login_info()
    smtp_server = login.get("smtp_server", default_login.get("smtp_server", SMTP))
    smtp_port = login.get("smtp_port", default_login.get("smtp_port", PORT))
    smtp_ssl = login.get("smtp_ssl", default_login.get("smtp_ssl", True))
    if smtp_ssl:
        mailserver = smtplib.SMTP_SSL(
            smtp_server, smtp_port, context=ssl.create_default_context()
        )
    else:
        mailserver = smtplib.SMTP(smtp_server, smtp_port)
    mailserver.set_debuglevel(1)
    if login:
        username = login.get("ldap_username")
        password = login.get("ldap_password")
        if username and password:
            mailserver.login(username, password)
    mailserver.sendmail(From, To, msg)
    mailserver.quit()