Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I just tried SMTPop and it worked.</p> <ol> <li>I downloaded <a href="http://sourceforge.net/projects/dotnetctrlext/files/smtpop.net/SmtPop.Net%20V%200.5a/smtpop_bin_0.5.1.33667.zip/download" rel="nofollow">this</a>. </li> <li>Added <code>smtpop.dll</code> reference to my C# .NET project</li> </ol> <p>Wrote the following code:</p> <pre><code>using System; using System.Collections.Generic; using System.Linq; using System.Text; using SmtPop; namespace SMT_POP3 { class Program { static void Main(string[] args) { SmtPop.POP3Client pop = new SmtPop.POP3Client(); pop.Open("&lt;hostURL&gt;", 110, "&lt;username&gt;", "&lt;password&gt;"); // Get message list from POP server SmtPop.POPMessageId[] messages = pop.GetMailList(); if (messages != null) { // Walk attachment list foreach(SmtPop.POPMessageId id in messages) { SmtPop.POPReader reader= pop.GetMailReader(id); SmtPop.MimeMessage msg = new SmtPop.MimeMessage(); // Read message msg.Read(reader); if (msg.AddressFrom != null) { String from= msg.AddressFrom[0].Name; Console.WriteLine("from: " + from); } if (msg.Subject != null) { String subject = msg.Subject; Console.WriteLine("subject: "+ subject); } if (msg.Body != null) { String body = msg.Body; Console.WriteLine("body: " + body); } if (msg.Attachments != null &amp;&amp; false) { // Do something with first attachment SmtPop.MimeAttachment attach = msg.Attachments[0]; if (attach.Filename == "data") { // Read data from attachment Byte[] b = Convert.FromBase64String(attach.Body); System.IO.MemoryStream mem = new System.IO.MemoryStream(b, false); //BinaryFormatter f = new BinaryFormatter(); // DataClass data= (DataClass)f.Deserialize(mem); mem.Close(); } // Delete message // pop.Dele(id.Id); } } } pop.Quit(); } } } </code></pre>
    singulars
    1. This table or related slice is empty.
    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.
 

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