-
-
Notifications
You must be signed in to change notification settings - Fork 805
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't authenticate with Gmail #585
Comments
Follow the Trouble Shooting directions on the site you linked. Did you enable “less secure apps”? |
Thanks @jstedfast. I followed the troubleshooting section. I resolved this issue by creating an App password specifically for MailKit, and modifying the code to use this new App password. I find it odd that I did not have to do this for Firebird. |
I don't need to do that for MailKit either... but I guess that's one way. |
This is what I was driving at: https://support.google.com/accounts/answer/6010255 You only need app-specific passwords if you use 2-factor auth. |
Also: Thunderbird supports OAuth 2.0 (so does MailKit, but it leaves it up to you to get the OAuth 2.0 credentials because there are so many OAuth 2.0 client libraries that I don't want to force you into a specific one). |
I'm trying to connect to Gmail using IMAP but I can't get passed authentication. I'm not sure what I'm doing wrong. When calling
client.Authenticate()
, it throws "MailKit.Security.AuthenticationException: 'Invalid credentials (Failure)'". I know for sure that I'm passing the correct username and password. I'm using my full email address as my username (eg: "some.email.address@gmail.com").I have confirmed that IMAP is enabled for my account and I tested this by using Mozilla Firebird email client.
Here's Gmail IMAP settings: https://support.google.com/mail/answer/7126229?hl=en
Here's the code that I used to reproduce the issue. I replaced my real username and password for obvious reasons.
I would provide logs as instructed but it just contains my username and password that I'm not willing to share.
If someone can tell me how I can get this code to properly authenticate with Gmail, that would be really helpful. Thank you so much!
The text was updated successfully, but these errors were encountered: