def open_smtp(settings):
    """
    Connects to the SMTP server using mail.settings.
    
    Returns SMTP server object, connected and logged in.
    """
    import smtplib
    host, port = settings.server.split(':')
    username, password = settings.login.split(':')
    try:
        serv = smtplib.SMTP(host, port)
        serv.ehlo()
        serv.starttls()
        serv.ehlo()
        serv.login(username, password)
    except:
        serv = None
    return serv
