{"id":911,"date":"2010-05-30T11:59:33","date_gmt":"2010-05-30T09:59:33","guid":{"rendered":"http:\/\/www.limilabs.com\/blog\/?p=911"},"modified":"2013-06-25T22:43:03","modified_gmt":"2013-06-25T20:43:03","slug":"free-yahoo-mail-via-imap","status":"publish","type":"post","link":"https:\/\/www.limilabs.com\/blog\/free-yahoo-mail-via-imap","title":{"rendered":"Free Yahoo! Mail via IMAP"},"content":{"rendered":"<p><img loading=\"lazy\" decoding=\"async\" src=\"\/blog\/wp-content\/uploads\/2010\/05\/yahoo.gif\" alt=\"\" title=\"yahoo IMAP\" width=\"142\" height=\"38\" class=\"alignleft size-full wp-image-917\" \/><\/p>\n<p><strong>Update: Mail.dll issues custom ID command automatically, when it recognizes you are accessing yahoo server.<\/strong><\/p>\n<p>It is possible to get direct Yahoo! IMAP access.<br \/>\nYahoo! operates IMAP servers (imap.mail.yahoo.com in particular), which are globally accessible.<br \/>\nHowever <strong>they require a specific, but non-standard IMAP command to be sent before login<\/strong> is done. The command is: \u201cID (&#8220;GUID&#8221; &#8220;1&#8221;)\u201d<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\n\/\/ C#\r\nimap.SendCommand(@&quot;ID (&quot;&quot;GUID&quot;&quot; &quot;&quot;1&quot;&quot;)&quot;);\r\n<\/pre>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n' VB\r\nimap.SendCommand(&quot;ID (&quot;&quot;GUID&quot;&quot; &quot;&quot;1&quot;&quot;)&quot;)\r\n<\/pre>\n<p>You can also use IMAP over SSL on the standard port 993.<\/p>\n<p>Here&#8217;s the full <strong>C#<\/strong> version of the code:<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\nusing (Imap imap = new Imap())\r\n{\r\n\timap.ConnectSSL(&quot;imap.mail.yahoo.com&quot;);\r\n\r\n\t\/\/ Not needed as Mail.dll is going to issue this command automatically\r\n\t\/\/ imap.SendCommand(@&quot;ID (&quot;&quot;GUID&quot;&quot; &quot;&quot;1&quot;&quot;)&quot;);\r\n\r\n\timap.Login(&quot;user&quot;, &quot;password&quot;);\r\n\r\n\timap.SelectInbox();\r\n\tList&lt;long&gt; uidList = imap.Search(Expression.All());\r\n\tforeach (long uid in uidList)\r\n\t{\r\n\t\tIMail email = new MailBuilder()\r\n    \t\t\t.CreateFromEml(imap.GetMessageByUID(uid));\r\n\t\tConsole.WriteLine(email.Subject);\r\n\t}\r\n\timap.Close();\r\n}\r\n<\/pre>\n<p>and <strong>VB.NET<\/strong> version:<\/p>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\nUsing imap As New Imap()\r\n\timap.ConnectSSL(&quot;imap.mail.yahoo.com&quot;)\r\n\r\n\t' Not needed as Mail.dll is going to issue this command automatically\r\n\t'imap.SendCommand(&quot;ID (&quot;&quot;GUID&quot;&quot; &quot;&quot;1&quot;&quot;)&quot;)\r\n\r\n\timap.Login(&quot;user&quot;, &quot;password&quot;)\r\n\r\n\timap.SelectInbox()\r\n\tDim uidList As List(Of Long) = imap.Search(Expression.All())\r\n\tFor Each uid As Long In uidList\r\n\t\tDim email As IMail = New MailBuilder() _\r\n\t\t\t.CreateFromEml(imap.GetMessageByUID(uid))\r\n\t\tConsole.WriteLine(email.Subject)\r\n\tNext\r\n\timap.Close()\r\nEnd Using\r\n<\/pre>\n<p>Yahoo&#8217;s IMAP server differences:<br \/>\n&#8211; non-standard command ID command is required before any other command,<br \/>\n&#8211; Examine explicitly requires CLOSE command (Imap.CloseCurrentFolder), otherwise subsequent SELECT (Imap.Select) has no effect and mailbox is still in read-only stat,<br \/>\n-Yahoo does not support IDLE command,<br \/>\n&#8211; SELECT for not existing folder does not create new folder.<\/p>\n<p>You can download the latest version of <a href=\"\/mail\">Mail.dll .NET IMAP component here<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Update: Mail.dll issues custom ID command automatically, when it recognizes you are accessing yahoo server. It is possible to get direct Yahoo! IMAP access. Yahoo! operates IMAP servers (imap.mail.yahoo.com in particular), which are globally accessible. However they require a specific, but non-standard IMAP command to be sent before login is done. The command is: \u201cID [&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,28,77,57,69],"class_list":["post-911","post","type-post","status-publish","format-standard","hentry","category-mail-dll","tag-c","tag-imap","tag-imap-component","tag-vb-net","tag-yahoo"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/911"}],"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=911"}],"version-history":[{"count":4,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/911\/revisions"}],"predecessor-version":[{"id":4058,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/911\/revisions\/4058"}],"wp:attachment":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/media?parent=911"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/categories?post=911"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/tags?post=911"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}