def __init__(self, username=None, name=None):
self.session = smtplib.SMTP('<STR_LIT>', <NUM_LIT>)<EOL>self.session.ehlo()<EOL>self.session.starttls()<EOL>if name is None:<EOL><INDENT>self.name = gmail_name<EOL><DEDENT>else:<EOL><INDENT>self.name = name<EOL><DEDENT>if username is None:<EOL><INDENT>self.username = gmail_sender<EOL><DEDENT>else:<EOL><INDENT>self.username = username<EOL><DEDENT>self.password = None<EOL>self.get_password()<EOL>self.session.login(self.username,self.password)<EOL>
Open an SMTP TLS session for gmail.