def METHOD_NAME(framework_info, email_domain):
    guessed_user = None
    if framework_info["user"] != "root":
        guessed_user = framework_info["user"]
    elif framework_info["name"].startswith(JUPYTER_PREFIX):
        try:
            # the job format is now `<AppName>_<UserName>_<UIPort>_<StartTime>`
            guessed_user = framework_info["name"].split("_")[-3]
        except IndexError:
            pass
    if guessed_user:
        print(
            f'Guessed {framework_info["name"]} belongs to {guessed_user}, sending email'
        )
    else:
        print(f"Could not guess user from {framework_info}, skipping user email")
        return
    msg = EmailMessage()
    msg["From"] = email_from_address
    msg["To"] = f"{guessed_user}@{email_domain}"
    msg["Subject"] = f'Long-running Spark framework {framework_info["name"]}'
    content = "Please check why it is still running and terminate if appropriate.\n"
    content += format_framework(framework_info)
    msg.set_content(content)
    with smtplib.SMTP("localhost") as s:
        s.send_message(msg)