import smtplib


def prep_smtp_instance(kwargs):
    """
    Prepare a smtplib.SMTP/SMTP_SSL instance.

    :param is_ssl: True if server uses SSL, False if TLS only.
    :type is_ssl: bool

    :param server: SMTP email server.
    :type server: str

    :param port: Port to use.
    :type port: int
    """
    args = kwargs['server'], kwargs['port']
    smt = smtplib.SMTP_SSL(*args) if kwargs['is_ssl'] else smtplib.SMTP(*args)
    return smt