SMTP Server Authentication

How come I got the AttributeError: login with the following code?

smtp_server = ‘smtp.gmail.com
server = smtplib.SMTP(smtp_server)
server.login(“username”, “password”) # authentication

BTW, neither could I do:

server.starttls() # issue a STARTTLS command

Regards,
David