0

I'm trying to find C#/VB.net examples to learn how to run oauth2 with gmail. Looking to recode an existing application that used to used gmails app password to send automated emails (logging in with just user name and password). Google turned that feature off and now requires oauth 2.0. The windows desktop application uses just a single gmail account and no other APIs from google so it should be a simple http request and response for the credentials (i think). not sure how to manage this oauth process though as it's set up for much more complicated interactions. The application is using IMapX dll to manage the email interactions which isn't a paid utility and seems to have limited support anymore.

Found this in c# which I wasn't able to convert: enter link description here How do you use Basic Authentication with System.Net.Http.HttpClient?

Going over google docs hasn't helped much and their example code is in python, etc. which wasn't helpful.

  • SO is not a free code conversion service. We're more than happy to help once you've made an effort to solve the problem yourself and run into difficulties. When that happens, you can explain the problem you're having, include both the relevant original code and your effort to convert it, and ask a specific question related to that code, and we'll try to help. You'll find your experiences here will be much better if you spend some time taking the [tour] and reading the [help] pages to learn how the site works before you begin posting, as was suggested when you created your account. – Ken White Jun 10 '22 at 03:50

1 Answers1

0

First off go to your google account and create an apps password

replace the actual password to the account with the apps password. See if that works.

It it doesnt then begin consider switching to xoauth2. I am currently working on a sample for that in C# hang in there.

Linda Lawton - DaImTo
  • 106,405
  • 32
  • 180
  • 449