473,326 Members | 2,196 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Reading Email Using C#

I need to be able to read emails with the POP3 of C#. I have gotten the code so far:


// connect to pop3 server
POP3Client pop = new POP3Client ();
pop.ReceiveTimeout = 3 * 60000; // Set the timeout to 3 minutes
pop.Open ("mymailserver", "110", "sampleuser", "password");

// retrieve messages list from pop server
POPMessageId[] messages = pop.GetMailList ();

if (messages != null)
{
// run through available messages in POP3 server
foreach (POPMessageId id in messages)
{
POPReader reader = pop.GetMailReader (id.Id);
MimeMessage msg = new MimeMessage ();

// read the message
msg.Read (reader);
//delete message
pop.Dele (id.Id);
}
}
//close the connection to POP3 server
pop.Quit ();

but I am having trouble with the POPReader with the "id.Id". Help would be appreciated.
Oct 16 '11 #1
0 1522

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: James | last post by:
How can I take my form data and send it as an email using my SMTP server located @ my ISP using PHP ? my form has several fields: TO: this is a drop down list FROM: this is a drop down...
0
by: Brad Pears | last post by:
Our web site is hosted on our providers site where ASP is installed. On our website, we generate an email containing personal data including credit card info whenever someone orders a product...
11
by: Mohammed Abdel-Razzak | last post by:
dear sirs i want to send email using c# but i don`t want to use CDONTS or tell me how can i use it i don`t know any thing about CDONTS thanks
3
by: Srinivas | last post by:
Hi, I am using ASP.NET SmtpMail to send email using the following code public void SendEmail(string From, string To, string Subject, StringBuilder Message, string Attachment, string...
0
by: Phil Endecott | last post by:
Dear PostgreSQL people, I thought that some of you might be interested to know about Decimail, a new IMAP mail server that I've written that uses PostgreSQL to implement its message store. ...
3
by: minaalashokvijaya | last post by:
can anybody out there please help me in my project i.e., to read the contents of the email using vb.net code ........!!! plz plz plz, i really need ya.......................
4
Frinavale
by: Frinavale | last post by:
Introduction Many .NET applications will require an email be sent out for various reasons. This article will give a quick examples on how to send an email using VB.NET. The examples given can...
0
by: filox | last post by:
i've just installed django and it seems pretty cool. i've managed to send an email succesfully, but i didn't find any information on reading email. is that even possible with django (e.g. open my...
0
by: Hamayun Khan | last post by:
Salam Reading email from mailserver return some extra character like 3D =20 = following is the mail body i read from mailserver through php code <HTML><HEAD>
1
by: unixrockx | last post by:
Hi All, Can anyone help me in writing a shell script to read an email. Thanks
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.