<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def send_msg(from_addr: str, to_addrs: Union[str, List[str]], host: str, user: str, password: str, port: int = None, use_tls: bool = True, msg: email.mime.multipart.MIMEMultipart = None, msg_string: str = None) -> None: """ Sends a pre-built e-mail message. Args: from_addr: e-mail address for 'From:' field to_addrs: address or list of addresses to transmit to host: mail server host user: username on mail server password: password for username on mail server port: port to use, or ``None`` for protocol default use_tls: use TLS, rather than plain SMTP? msg: a :class:`email.mime.multipart.MIMEMultipart` msg_string: alternative: specify the message as a raw string Raises: :exc:`RuntimeError` See also: - https://tools.ietf.org/html/rfc3207 """

    assert bool(msg) != bool(msg_string), "Specify either msg or msg_string"
    # Connect
    try:
        session = smtplib.SMTP(host, port)
    except smtplib.SMTPException as e:
        raise RuntimeError(
            "send_msg: Failed to connect to host {}, port {}: {}".format(
                host, port, e))
    try:
        session.ehlo()
    except smtplib.SMTPException as e:
        raise RuntimeError("send_msg: Failed to issue EHLO: {}".format(e))

    if use_tls:
        try:
            session.starttls()
            session.ehlo()
        except smtplib.SMTPException as e:
            raise RuntimeError(
                "send_msg: Failed to initiate TLS: {}".format(e))

    # Log in
    if user:
        try:
            session.login(user, password)
        except smtplib.SMTPException as e:
            raise RuntimeError(
                "send_msg: Failed to login as user {}: {}".format(user, e))
    else:
        log.debug("Not using SMTP AUTH; no user specified")
        # For systems with... lax... security requirements

    # Send
    try:
        session.sendmail(from_addr, to_addrs, msg.as_string())
    except smtplib.SMTPException as e:
        raise RuntimeError("send_msg: Failed to send e-mail: {}".format(e))

    # Log out
    session.quit()