tldr: Can someone show me how to properly format this Python iMAP example so it works?
from https://docs.python.org/2.4/lib/imap4-example.html
<
Instead of M.login(getpass.getuser(email@gmail.com), getpass.getpass(password))
you need to use M.login('email@gmail.com', 'password')
, i.e. plain strings (or better, variables containing them). Your attempt actually shouldn't have worked at all, since getpass's getuser
doesn't take arguments but merely returns the user login name. And email@gmail.com
isn't even a valid variable name (you didn't put it into quotes)...