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.
Library tutorials & articles
How to POP3 in C#
By Randy Charles Morin, updated on 28 Sep 2008
Introduction
Related articles
Related discussion
-
How i can send mails POP3 or IMAP using .net also
by James Crowley (1 replies)
Related podcasts
-
Parleys.com: Get Value Objects right for Domain Driven Design
Published 3 years ago, running time 0h58m
The technique of domain logical value-objects (DLVO) is a method for domain-driven programming that stays close to the code. It takes the "middle road" by identifying domain concepts that are more than "just data" (e g strings and integers), but stil...
Events coming up
-
Aug
2
New England F# User Group: F# Workflows
Cambridge, United States
F# Workflows are a powerful and elegant tool for solving many real-world problems, though they can be rather daunting at first. We'll survey some ways in which Workflows in the standard F# libraries are used for common development tasks, then dig into detail on how they work.
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
!--removed tag-->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?
!--removed tag-->When i change the port to 587 from 110 i got the following error
220 mx.google.com ESMTP g14sm11215098rvb.54
!--removed tag-->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); } }
!--removed tag-->This code does not work for me. It comes up with red squiggly lines under the Response() and Write words in the code. And it tells me to generate a method stub!???
!--removed tag-->