'Returns appropriate SMTP port number depending on incoming server name and boolean ssl'

def get_smtp_port(self, server):

    port = 25
    ssl = False
    if (('gmail.com' in server) or ('googlemail.com' in server)):
        port = 587
        ssl = False
    elif (server == 'plus.smtp.mail.yahoo.com'):
        if hasattr(smtplib, 'SMTP_SSL'):
            port = 465
        ssl = True
    if ((server == 'smtp.live.com') or (server == 'smtp.isp.netscape.com')):
        ssl = True
    return (port, ssl)
