Share via


Receive pop3 mails using C#

Question

Tuesday, May 20, 2014 6:47 AM

Looking for POP3 mail client which can recieve mails from the pop3 exchange server using C#. 

saikalyan

All replies (3)

Tuesday, May 20, 2014 12:37 PM âś…Answered | 1 vote

Hello SAI KALYAN,

download the source code from the tutorial at [1] and add the two classes in your project. Write the following code to connect to the pop3 server and get the first Email Body of your Mail.

waspPOP3 pop3;
pop3 = new waspPOP3();
pop3.DoConnect("pop.yourmailserver.com", 110, "yourmailaddress", "password");//check if the port is correct.
pop3.GetStat();
waspMessage msg;
msg = new waspMessage();
string sMessageTop = pop3.GetTop(1);
string sAllMessage = pop3.Retr(1);
Console.WriteLine(msg.GetBody(sAllMessage));//write the body of the message in console.
Console.ReadLine();

I have successfully got the Email from my Mailbox with this code.

[1] http://www.codeproject.com/Articles/3166/Using-POP-with-C-to-download-and-parse-your-mail

Regards,
Bo Liu
App-Entwickler-Hotline for MSDN Online Germany

Disclaimer:
Please take into consideration, that further inquiries cannot or will be answered with delay.
For further information please contact us per telephone through the App-Entwickler-Hotline: http://www.msdn-online.de/Hotline

For this post by the App-Entwickler-Hotline the following terms and conditions apply: Trademarks, Privacy as well as the separate terms of use for die App-Entwickler-Hotline.


Tuesday, May 20, 2014 8:51 AM | 1 vote

Hello,

   For receiving mails from the pop3 exchange server,

[http://www.codeproject.com/Articles/1733/Retrieve-Mail-From-a-POP-Server-Using-C

or

](http://www.codeproject.com/Articles/1733/Retrieve-Mail-From-a-POP-Server-Using-C)[http://www.codeproject.com/Articles/3166/Using-POP-with-C-to-download-and-parse-your-mail

](http://www.codeproject.com/Articles/3166/Using-POP-with-C-to-download-and-parse-your-mail)
 if the reply help you mark it as your answer.
 Free Managed .NET ExcelWordPDF Component(Create, Modify, Convert & Print)


Tuesday, May 20, 2014 10:43 AM

I am able to connect with the credentials but dont see my mails being shown still.

saikalyan