Library tutorials & articles

How to POP3 in C#

Introduction

This is the second in a series of articles on Internet programming with Microsoft's new C# programming language. In the first article, I wrote a simple SMTP class. In this article, I'm going to write a simple POP3 class. The SMTP class that I wrote was not very useful, except maybe as an exercise, as there already exists a similar SMTP class in the Web.Mail namespace of the .NET framework called SmtpMail. Our POP3 class in this article will be a little more useful as it doesn't already exist in the .NET framework. I have encountered many POP3 C# classes in my searches of the Internet and most were sufficient to begin programming email clients.

Comments

  1. 13 Nov 2009 at 05:32

    As a professional VOB converter, Emicsoft VOB Converter is currently one of the best and most easy-to-use converter which can convert VOB videos to most popular video and audio formats with fast conversion speed and perfect sound & picture quality, such as VOB to MP3, VOB to M4A, VOB to WAV, VOB to AAC, VOB to AC3; VOB to DVD Video(.vob), DVD Video-NTSC(.vob), MPEG-1 Video(.mpg), MPEG-2 Video (.mpg), etc.

    Emicsoft VOB Converter can not only play the role as a converter, moreover, it can also be used as a powerful editor, which provides a lot of professional video editing functions, such as merging several videos into one file, cutting any clip of your video, cropping the video size, editing video effect and so on. You can also set output profile parameters including resolution, bitrate, frame rate, aspect ratio to get the best video quality and video size.

    How to convert VOB to other formats?

    1. Launch the software and click "Add File" button to import files into the software. You can watch them on the preview screen.
    2. Edit the added movie by clicking "Effect" "Trim" or "Crop" button which can help you create unique videos easily.
    3. Select output in Profile option. Here all popular formats and mobile devices are supported. Then make sure the destination folder.
    4. Click "Start" button and the program will automatically start conversion.

    Emicsoft VOB Converter is so outstanding with powerful converting functions and editing functions that you can enjoy it as a good helper.

    Emicsoft M2TS Converter is currently considered as one of the most professional conversion tool, due to its powerful function, user-friendly interface and easy-to-use operation design. It can achieve any video formats from M2TS to MPEG1, MPEG2, SWF, FLV, DivX, XviD, QuickTime Video, DV, AVI, MP4, WMV and HD videos, so as to make it available to sync M2TS to iPod, iPhone, PSP, BlackBerry and other mobile devices.

    Emicsoft Tod Converter is an easy-to-use HD Video conversion tool which helps you convert HD video Tod to other formats like FLV, SWF, AVI, M4V, MOV, DivX, XviD, MPEG-1, MPEG-2, VOB, MP4, M4V, RM, RMVB, WMV, MKV, AVI, 3GP, HD video with high output quality and fast converting speed. Apart from as a HD video converter, it is also a audio converter and extractor, the Emicsoft Tod Converter can aid you to extract music from Tod video such as WAV, OGG, WMA, MP3 with good sound quality.

    More softwares may help you: Emicsoft Video Converter Emicsoft FLV Converter Emicsoft MTS Converter

  2. 13 Nov 2009 at 02:36

    hi all ,I have tried

    but it does't work ,the message is : "-ERR Cannot connect to POP server 206.190.46.10 (206.190.46.10:110), connect error 10060\r\n"

    anyone can help ??

    thanks riry

    //----------------------------------------------- private void button1_Click(object sender, EventArgs e) { try { Pop3 obj = new Pop3(); obj.Connect("pop3.yahoo.com", "myusername", "mypassword"); ArrayList list = obj.List(); foreach (Pop3Message msg in list) { Pop3Message msg2 = obj.Retrieve(msg); System.Console.WriteLine("Message {0}: {1}", msg2.number, msg2.message); } obj.Disconnect(); } catch (Pop3Exception ex) { MessageBox.Show(ex.Message); } catch (System.Exception ex) { MessageBox.Show(ex.Message); } }

  3. 22 Jun 2009 at 14:22

    When i change the port to 587 from 110 i got the following error

    220 mx.google.com ESMTP g14sm11215098rvb.54

  4. 22 Jun 2009 at 14:17

    Hi Got the following error when i try to call

    obj.Connect("smtp.gmail.com", txtUser.Text, txtPass.Text);

    A Connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host failed to respond 209.85.199.111: 110

    Can any body please help me to fix this error?

  5. 01 Jun 2009 at 03:58

    Your code is too good. But in your code what happen If i send email today it display that email & tomarrow it show empty inbox. if i again send email it display that new mail only. And i also want to fetch Email subject,Email Body then what i do. Please give solution

  6. 19 Jan 2009 at 19:20
    **Image Hosted by ImageShack.us
    **
  7. 19 Jan 2009 at 19:20
    **I JUST GOT ERROR!!!!!! PLZ RESOLVE THIS ISSUE!!!! [URL=http://imageshack.us][IMG]http://img88.imageshack.us/img88/8177/errorsocketgy7.jpg[/IMG][/URL] [URL=http://g.imageshack.us/img88/errorsocketgy7.jpg/1/][IMG]http://img88.imageshack.us/img88/errorsocketgy7.jpg/1/w325.png[/IMG][/URL]**
  8. 19 Jan 2009 at 18:38
    ** TcpClient tcpClient=new TcpClient();**
  9. 19 Jan 2009 at 18:13
    **I don't know when this code was written but i do need to reference the TcpClient.Connect method! Guys who got confused like me do, TcpClient tcpClient=new TcpClien(); tcpClient.Connect();**
  10. 08 Dec 2008 at 10:22
    I t was cool needed quite alobarated to get the Mail.Body for specific Details... Thanks

Leave a comment

Sign in or Join us (it's free).

Randy Charles Morin Randy's article are Copyright 1998-2003 Randy Charles Morin

Related discussion

Related podcasts

Want to stay in touch with what's going on? Follow us on twitter!