March 2019
Beginner
490 pages
12h 40m
English
Now, we are going to go into detail regarding the code of the previous script. For reading, we first establish the connection to the Gmail pop server, using the getpass module to request the password:
# Connection is established with the gmail pop servermailbox = poplib.POP3_SSL ('pop.gmail.com', 995)import getpassusername = input('Enter your username:')password = getpass.getpass(prompt='Enter your password:')mailbox.user(username)mailbox.pass_(password)
Here, we used poplib.POP3_SSL, passing the name of the server, that is, pop.gmail.com, and the connection port, 995. Then, we have set the username and password of Gmail. The method to do this is pass_(), with an underscore at the end. ...
Read now
Unlock full access