import smtplib


def choose_smtp_class(port):
    """
    Chooses the right SMTP class to connect to the server based on the given port
    :param int port: Port on which to connect
    :return: The correct SMTP class and a bool to indicate if we are in SSL
    :rtype: tuple(SMTP, bool)
    """
    if port == 465:
        smtp = smtplib.SMTP_SSL
        ssl = True
    else:
        smtp = smtplib.SMTP
        ssl = False
    return smtp, ssl