POPLIB poplib.error_proto: b'-ERR [AUTH] Username and password not accepted.'

4.5k Views Asked by At

The following code works with another gmail account of mine, but fails with the account im now using, I've already set up POP3 for both accounts!

import email, poplib
from email.header import decode_header
_MAXLINE = 2048

login = '[email protected]'
password = 'genericpass'
pop_server = 'pop.gmail.com'
pop_port = '995'

mail_box = poplib.POP3_SSL(pop_server, pop_port)
mail_box.user(login)
mail_box.pass_(password)

The error:

raise error_proto(resp)
poplib.error_proto: b'-ERR [AUTH] Username and password not accepted.'
1

There are 1 best solutions below

4
Sebastian Tusk On

Try to enable "Access for less secure apps" in your Google Account.