Passing Login Credentials to Website
Is it possible to pass the login credentials to a website like Gmail in C#/.NET so the log-in happens automatically?
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Andrew FensterPosted Feb 4, 2010, 11:22 AM
There are several people who have written .NET IMAP code libraries. Here is an example. I don't know if it's a good example, or not, but it gives you an idea what's involved.
http://www.codeproject.com/KB/IP/imaplibrary.aspx
There are also third party web controls you can use. That may be an even better way to go.
Algo RhythmPosted Feb 4, 2010, 2:06 PM
Algo RhythmPosted Feb 4, 2010, 10:26 AM
Andrew FensterPosted Feb 4, 2010, 3:16 AM
MailMessage mail = new MailMessage();
mail.To.Add("[email protected]");
mail.From = new MailAddress("[email protected]");
mail.Subject = "Hello";
mail.Body = "Hello world!";
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.Credentials = new System.Net.NetworkCredential("[email protected]", "MyPassword");
smtp.EnableSsl = true;
smtp.Send(mail);
This code uses the GMail server to send an email. Notice you have to pass your GMail account information to the mail server.
I hope this helps.
Andy
Jan MontanoPosted Feb 4, 2010, 2:20 AM
2. Automating the login wherein you type your credentials programatically in the login page? If this is the case, Yes.
3. Go directly to your inbox, passing your credentials? I have no idea.