{"id":288,"date":"2009-12-01T17:54:04","date_gmt":"2009-12-01T15:54:04","guid":{"rendered":"http:\/\/www.limilabs.com\/blog\/?p=288"},"modified":"2014-04-15T14:25:56","modified_gmt":"2014-04-15T12:25:56","slug":"download-emails-gmail-pop3","status":"publish","type":"post","link":"https:\/\/www.limilabs.com\/blog\/download-emails-gmail-pop3","title":{"rendered":"Download emails from Gmail via POP3"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"\/blog\/wp-content\/uploads\/2009\/11\/gmail.png\" alt=\"gmail\" title=\"gmail\" width=\"131\" height=\"61\" class=\"alignleft size-full wp-image-271\" \/><br \/>\nAccessing Gmail with POP3 is a bit different that accessing other POP3 servers. Still is quite easy with <a href=\"\/mail\">Mail.dll POP3  client<\/a>. Remember that POP3 protocol unlike IMAP does not store the unseen information on the server.<\/p>\n<p>Mail.dll has of course <a href=\"\/blog\/download-emails-from-gmail\">IMAP support<\/a><\/p>\n<p>First remember to <a href=\"\/blog\/enable-pop3-in-gmail\">enable POP3 in Gmail<\/a>.<\/p>\n<p>You can read more about <a href=\"\/blog\/gmail-pop3-behavior\">Gmail\u2019s POP3 behavior<\/a>.<\/p>\n<p>Remember that Gmail only allows <strong>secure SSL<\/strong> connections, so we need to use <em>ConnectSSL<\/em> method.<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\n\/\/ C# code:\r\n\r\nusing(Pop3 pop3 = new Pop3())\r\n{\r\n\tpop3.ConnectSSL(&quot;pop.gmail.com&quot;);\r\n\tpop3.Login(&quot;your_email@gmail.com&quot;, &quot;password&quot;);\r\n\r\n\tforeach (string uid in pop3.GetAll())\r\n\t{\r\n\t\tvar eml = pop3.GetMessageByUID(uid);\r\n\t\tIMail mail= new MailBuilder()\r\n\t\t\t.CreateFromEml(eml);\r\n\r\n\t\tConsole.WriteLine(mail.Subject);\r\n\t\tConsole.WriteLine(mail.Text);\r\n\t}\r\n\tpop3.Close();\r\n}\r\n\r\n<\/pre>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n' VB.NET code:\r\n\r\nUsing pop3 As New Pop3()\r\n    pop3.ConnectSSL(&quot;pop.gmail.com&quot;)\r\n    pop3.Login(&quot;your_email@gmail.com&quot;, &quot;password&quot;)\r\n\r\n    For Each uid As String In pop3.GetAll()\r\n        Dim email As IMail = New MailBuilder() _\r\n            .CreateFromEml(pop3.GetMessageByUID(uid))\r\n        Console.WriteLine(email.Subject)\r\n\tConsole.WriteLine(mail.Text)\r\n    Next\r\n    pop3.Close()\r\nEnd Using\r\n\r\n<\/pre>\n<p>If you want to have a<strong> greater control<\/strong> over your emails you should use<strong> IMAP<\/strong> protocol.<\/p>\n<p>With IMAP you can:<\/p>\n<ul>\n<li>access emails in different folders<\/li>\n<li>copy or move messages between folders<\/li>\n<li>mark messages read\/unread<\/li>\n<li>flag messages<\/li>\n<li><a href=\"\/blog\/get-email-information-from-imap-fast\">download emails&#8217; basic information very fast<\/a><\/li>\n<li>use <a href=\"\/blog\/imap-idle\">push email<\/a><\/li>\n<\/ul>\n<p>Check <a href=\"\/blog\/pop3-vs-imap\">POP3 vs IMAP <\/a>for details.<\/p>\n<p>Mail.dll contains ready to use IMAP client. Take a look on how to <a href=\"\/blog\/download-emails-from-gmail\">download email from Gmail using IMAP<\/a> sample.<\/p>\n<p>If you like the idea of simple Gmail access just give it a try for yourself and download it at: <a href=\"\/mail\">Mail.dll .NET email component<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Accessing Gmail with POP3 is a bit different that accessing other POP3 servers. Still is quite easy with Mail.dll POP3 client. Remember that POP3 protocol unlike IMAP does not store the unseen information on the server. Mail.dll has of course IMAP support First remember to enable POP3 in Gmail. You can read more about Gmail\u2019s [&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":[25,42,79],"class_list":["post-288","post","type-post","status-publish","format-standard","hentry","category-mail-dll","tag-gmail","tag-pop3","tag-pop3-component"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/288"}],"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=288"}],"version-history":[{"count":4,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/288\/revisions"}],"predecessor-version":[{"id":2653,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/288\/revisions\/2653"}],"wp:attachment":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/media?parent=288"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/categories?post=288"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/tags?post=288"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}