<gh_stars>1-10
import smtplib, ssl
from email.mime.text import MIMEText


def send_email(
    sender="<EMAIL>",
    host="smtp.cern.ch",
    port=587,
    subject="Error occurred",
    message="Error occurred",
    recipients=["<EMAIL>"],
    **kwargs
):

    password = kwargs.pop("password")

    if kwargs:
        raise TypeError("Unexpected kwargs provided: %s" % list(kwargs.keys()))

    msg = MIMEText(message, "plain")
    msg["Subject"] = subject
    msg["From"] = sender
    msg["To"] = ", ".join(recipients)

    context = ssl.create_default_context()

    server = smtplib.SMTP(host, port)
    server.starttls()
    server.login(sender, password)
    server.sendmail(sender, recipients, msg.as_string())

    return True
