Author |
|
ay1585 Newbie
Joined: 01 April 2009 Location: India
Online Status: Offline Posts: 7
|
Posted: 03 April 2009 at 7:13am | IP Logged
|
|
|
While connecting to Gmail Server (pop.gmail.com) with my gmail credentials,I am getting an Exception
"Socket connection has timed out . Inner exception message as follows: A connection exception failed because the connected party did not respond after a period of time, or established connection failed because connected host has failed to respond."
Please suggest me as to what I should do in such cases.
|
Back to Top |
|
|
Igor AfterLogic Support
Joined: 24 June 2008 Location: United States
Online Status: Offline Posts: 6104
|
Posted: 03 April 2009 at 7:27am | IP Logged
|
|
|
GMail requires accessing POP3 accounts via SSL. The following code sample performs connection to POP3 account, displays number of messages in Inbox:
Code:
Pop3 pop = new Pop3();
pop.SslMode = SslStartupMode.OnConnect;
pop.Connect("pop.gmail.com", 995);
pop.Login("login", "password");
Console.WriteLine(pop.InboxMessageCount + " message(s) in inbox");
pop.Disconnect();
Console.ReadLine(); |
|
|
The last line is used to keep console open until Enter is pressed, remove this line if you don't need it.
Regards,
Igor
|
Back to Top |
|
|