If you have not enabled less secure apps to access your email account, it may produce an error message.
Once you have enabled access through less secure apps, this recipe can log in as a POP3 client to your email account, retrieve an email from the account, and post it in the console.