I am using the following code to read from Gmail:
using (Pop3Client client = new Pop3Client())
{
// Connect to the server
client.Connect("pop.gmail.com", 995, true);
client.Authenticate("recent:[email protected]", "password1", OpenPop.Pop3.AuthenticationMethod.UsernameAndPassword);
Note that I can login with the credentials (note I have tweaked the username, password for security).
I keep in getting:
I keep on getting a message:
OpenPop.Pop3.Exceptions.InvalidLoginException: 'Server did not accept user credentials'
Note that I have enable POP in Gmail Setting. Gmail shows: Status: POP is enabled for all mail
Google accounts will only allow POP3 access if you have enabled the "less secure apps" feature. This can be done from this link: https://www.google.com/settings/security/lesssecureapps
However, if you have two-factor authentication enabled you won't be able to turn this setting on. Instead you can create a specific set of credentials that will also give you access. That can be done via this link: https://security.google.com/settings/security/apppasswords
The latter method is probably a better option anyway as it means you can delete that password without having to change your main account details.
I am suffering same Issue and I found the solution this way, and i will describe here.
1-enable the pop at Configurations / Forwarding and POP/IMAP
2- follow this link: https://www.google.com/settings/security/lesssecureapps
and activate for less secure apps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With