{"id":1268,"date":"2010-10-25T15:32:57","date_gmt":"2010-10-25T13:32:57","guid":{"rendered":"http:\/\/www.limilabs.com\/blog\/?p=1268"},"modified":"2014-08-16T12:22:27","modified_gmt":"2014-08-16T10:22:27","slug":"get-email-headers-using-pop3-top-command","status":"publish","type":"post","link":"https:\/\/www.limilabs.com\/blog\/get-email-headers-using-pop3-top-command","title":{"rendered":"Get email headers using POP3 (TOP command)"},"content":{"rendered":"<p>The POP3 protocol&#8217;s TOP command is useful to download only headers of the big email message, without actually downloading entire message including all attachments. With Mail.dll POP3 component it is easy to use TOP command, you simply invoke one of the <em>GetHeadersBy<\/em> method.<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\n\/\/ C# version\r\n\r\nusing System;\r\nusing Limilabs.Mail;\r\nusing Limilabs.Client.POP3;\r\n\r\nclass Program\r\n{\r\n    static void Main(string&#x5B;] args)\r\n    {\r\n        using (Pop3 pop3 = new Pop3())\r\n        {\r\n            pop3.Connect(&quot;pop3.example.com&quot;);    \/\/ or ConnectSSL\r\n            pop3.Login(&quot;user&quot;, &quot;password&quot;);\r\n\r\n            MailBuilder builder = new MailBuilder();\r\n            foreach (string uid in pop3.GetAll())\r\n            {\r\n                var headers = pop3.GetHeadersByUID(uid);\r\n                IMail email = builder.CreateFromEml(headers);\r\n\r\n                Console.WriteLine(&quot;subject: {0}&quot;, email.Subject);\r\n            }\r\n            pop3.Close();\r\n        }\r\n    }\r\n}\r\n<\/pre>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n' VB.NET version\r\n\r\nImports System\r\nImports Limilabs.Mail\r\nImports Limilabs.Client.POP3\r\n\r\nPublic Module Module1\r\n    Public Sub Main(ByVal args As String())\r\n\r\n        Using pop3 As New Pop3()\r\n            pop3.Connect(&quot;pop3.example.com&quot;)    ' or ConnectSSL\r\n            pop3.Login(&quot;user&quot;, &quot;password&quot;)\r\n\r\n            Dim builder As New MailBuilder()\r\n            For Each uid As String In pop3.GetAll()\r\n                Dim headers = pop3.GetHeadersByUID(uid)\r\n                Dim email As IMail = builder.CreateFromEml(headers)\r\n\r\n                Console.WriteLine(&quot;subject: {0}&quot;, email.Subject)\r\n            Next\r\n            pop3.Close()\r\n        End Using\r\n\r\n    End Sub\r\nEnd Module\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The POP3 protocol&#8217;s TOP command is useful to download only headers of the big email message, without actually downloading entire message including all attachments. With Mail.dll POP3 component it is easy to use TOP command, you simply invoke one of the GetHeadersBy method. \/\/ C# version using System; using Limilabs.Mail; using Limilabs.Client.POP3; class Program { [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[15,33,42,79,57],"class_list":["post-1268","post","type-post","status-publish","format-standard","hentry","category-mail-dll","tag-c","tag-email-component","tag-pop3","tag-pop3-component","tag-vb-net"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/1268"}],"collection":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/comments?post=1268"}],"version-history":[{"count":5,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/1268\/revisions"}],"predecessor-version":[{"id":4777,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/1268\/revisions\/4777"}],"wp:attachment":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/media?parent=1268"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/categories?post=1268"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/tags?post=1268"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}