Can't connect to the server

Oct 3, 2011 at 7:01 AM

Hi,
I am trying to connect to the Live Mail server using POP3 or SMTP. However, somehow I cannot connect to it. Here are the details that I am using to connect to the Windows Live Server:

1. POP3

pop3.live.com:995

2. SMTP

smtp.live.com:25

Here is the code:

var client = new Pop3Client();
            client.Security = SecurityPolicies.Explicit;
            client.Connect("pop3.live.com", 995);

            
            if (client.IsConnected)
            {
                System.Net.NetworkCredential credentials = new System.Net.NetworkCredential(tbx_Username.Text.Trim(), tbx_Password.Password.Trim());
                bool isAuthenticated = client.Authenticate(credentials, SaslMechanics.Login);

                if (isAuthenticated == true)
                {
                    MessageBox.Show("Varified!");
                }
                else
                {
                    MessageBox.Show("Not Varified!");
                }
            }
            else
            {
                MessageBox.Show("Something went wrong while connecting to the mail server!", "Mail Server Connection Problem", MessageBoxButton.OK, MessageBoxImage.Error);
            }

I hope, SSL is not required for this purpose because if that is the reason. Can you please give me a link to check it out?

 

Thanks,

Farrukh Javeid

Coordinator
Oct 3, 2011 at 4:04 PM

Hi Farrukh,

the ports for your connecting to the server are default ports for use without SSL, but you enabled SSL by setting the Security property to explicit.

It should work if you remove this line.

client.Security = SecurityPolicies.Explicit;

If SSL is required you will need to use different ports, default SSL ports can be easily looked up on wikipedia.

Regards

Alexander