WebClient: Login to Gmail

I am trying to login to Gmail using:

WebClient Web = new WebClient();
Web.Credentials = new NetworkCredential(Email, Password, "https://mail.google.com");

      

and then view the email using the interface IHTMLDocument2

, setting the id associated with each email, generating the url, going to that url and using the method DownloadString

, pass the HTML content to the interface IHTMLDocument2

.

The problem is that Google does not accept the credentials I submit, so I can never login. However, after several attempts, I saw that this activity was being tracked by Google, as I saw a notification of this on the actual email address of Invoice.

I would like to know how this problem can be solved or is it even possible to log into Gmail using WebClient

? if so, how exactly?

+3


source to share


1 answer


Use Fiddler to watch what the browser is doing. Fiddler can capture HTTPS traffic. Signing in to Google is more difficult than you might think.



The property has Credentials

no effect on web forms. There is no standardized way to have an HTML login form. WebClient

can't know how google login form works. It cannot automate this for you.

+1


source







All Articles