Archived Forum Post

Index of archived forum posts

Question:

How to get email from pod51018.outlook.com port 995 with SSL in C#?

Dec 03 '12 at 13:44

How to get email from pod51018.outlook.com port 995 with SSL in C#?


Answer

This problem should be approached in the same way as for any other mail service provider -- whether it be your ISP, yahoo.com, GMail, or any of the innumerable mail service providers on the Internet.

Step 1. Find the online documentation published by the mail service provider. In this case, go to Google and search for "outlook.com mail settings". Choose the search result at the provider's website. In this case, it's http://help.outlook.com/

Step 2. Read the information about the email settings: Get the server hostname for each protocol supported (POP3, IMAP, SMTP), the port numbers, SSL/TLS requirements (explicit, implicit, or none), etc.

Step 3. Set the corresponding Chilkat.MailMan (or Chilkat.Imap) properties to the values required by the mail service provider.


Answer

I found one of the "Chilkat C# Examples" and ran the code in a console application. The bundle == null forever. I used correct uid/pwd/port/ssl, which work successfully with OpenPop.net. Please explain why and help.

// The mailman object is used for receiving (POP3) // and sending (SMTP) email. Chilkat.MailMan mailman = new Chilkat.MailMan();

// Any string argument automatically begins the 30-day trial. bool success; success = mailman.UnlockComponent("30-day trial"); if (success != true) { MessageBox.Show("Component unlock failed"); return; }

// Set the POP3 server's hostname mailman.MailHost = "pop.gmail.com";

// Set the POP3 login/password. mailman.PopUsername = "****@gmail.com"; mailman.PopPassword = "****";

// Indicate that we want TLS/SSL. Also, set the port to 995: mailman.MailPort = 995; mailman.PopSsl = true;

Chilkat.EmailBundle bundle = null; // Read mail headers and one line of the body. bundle = mailman.CopyMail();

if (bundle == null ) { MessageBox.Show(mailman.LastErrorText); return; }

int i; Chilkat.Email email = null; for (i = 0; i <= bundle.MessageCount - 1; i++) { email = bundle.GetEmail(i);

//  Display the From email address and the subject.
textBox1.Text += email.From + "\r\n";
textBox1.Text += email.Subject + "\r\n" + "\r\n";

}


Answer

I posted a follow-up question.


Answer

This line of code makes a difference when the key replaced "30-day trial":

success = mailman.UnlockComponent("30-day trial");