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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Andrew FensterRank #983 · 2K reputationPosted Feb 4, 2010, 6:22 AM EST
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.
Jan MontanoRank #1,295 · 1.3K reputationPosted Feb 3, 2010, 9:20 PM EST
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.
Andrew FensterRank #983 · 2K reputationPosted Feb 3, 2010, 10:16 PM EST
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
Algo Rhythm40 reputationPosted Feb 4, 2010, 5:26 AM EST
Algo Rhythm40 reputationPosted Feb 4, 2010, 9:06 AM EST