Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>downloading the email via the POP3 protocol is the easy part of the task. The protocol is quite simple and the only hard part could be advanced authentication methods if you don't want to send a clear text password over the network (and cannot use the SSL encrypted communication channel). See <a href="http://www.ietf.org/rfc/rfc1939.txt" rel="noreferrer">RFC 1939: Post Office Protocol - Version 3 </a> and <a href="http://www.ietf.org/rfc/rfc1734.txt" rel="noreferrer">RFC 1734: POP3 AUTHentication command</a> for details.</p> <p>The hard part comes when you have to parse the received email, which means parsing MIME format in most cases. You can write quick&amp;dirty MIME parser in a few hours or days and it will handle 95+% of all incoming messages. Improving the parser so it can parse almost any email means:</p> <ul> <li>getting email samples sent from the most popular mail clients and improve the parser in order to fix errors and RFC misinterpretations generated by them.</li> <li>Making sure that messages violating RFC for message headers and content will not crash your parser and that you will be able to read every readable or guessable value from the mangled email</li> <li>correct handling of internationalization issues (e.g. languages written from righ to left, correct encoding for specific language etc) </li> <li>UNICODE</li> <li>Attachments and hierarchical message item tree as seen in <a href="http://www.rebex.net/secure-mail.net/sample-mime-explorer.aspx" rel="noreferrer">"Mime torture email sample"</a> </li> <li>S/MIME (signed and encrypted emails).</li> <li>and so on</li> </ul> <p>Debugging a robust MIME parser takes months of work. I know, because I was watching my friend writing one such parser for the component mentioned below and was writing a few unit tests for it too ;-)</p> <p>Back to the original question.</p> <p>Following <a href="http://www.rebex.net/secure-mail.net/tutorial-pop3.aspx#downloading" rel="noreferrer">code taken from our POP3 Tutorial page</a> and links would help you:</p> <pre><code>// // create client, connect and log in Pop3 client = new Pop3(); client.Connect("pop3.example.org"); client.Login("username", "password"); // get message list Pop3MessageCollection list = client.GetMessageList(); if (list.Count == 0) { Console.WriteLine("There are no messages in the mailbox."); } else { // download the first message MailMessage message = client.GetMailMessage(list[0].SequenceNumber); ... } client.Disconnect(); </code></pre> <ul> <li><a href="http://blog.rebex.net/news/archive/2007/05/14/howto-download-emails-from-gmail-account-in-csharp.aspx" rel="noreferrer">HOWTO: Download emails from a GMail account in C#</a> (blogpost)</li> <li><a href="http://www.rebex.net/mail.net/" rel="noreferrer">Rebex Mail for .NET (POP3/IMAP client component for .NET)</a></li> <li><a href="http://www.rebex.net/secure-mail.net/" rel="noreferrer">Rebex Secure Mail for .NET (POP3/IMAP client component for .NET - SSL enabled)</a> </li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload