{"id":1301,"date":"2010-10-25T15:47:52","date_gmt":"2010-10-25T13:47:52","guid":{"rendered":"http:\/\/www.limilabs.com\/blog\/?p=1301"},"modified":"2013-06-25T23:22:04","modified_gmt":"2013-06-25T21:22:04","slug":"display-html-email-in-windows-application","status":"publish","type":"post","link":"https:\/\/www.limilabs.com\/blog\/display-html-email-in-windows-application","title":{"rendered":"Display HTML email in windows application"},"content":{"rendered":"<p>We have a special Windows control to do this &#8211; <strong>MailBrowserControl<\/strong>.<\/p>\n<p>First you need to <strong>add reference <\/strong>to the three assemblies:<\/p>\n<ul>\n<li>Mail.dll<\/li>\n<li>MailBrowserControl.dll<\/li>\n<li>ProtocolEx.dll<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"467\" height=\"375\" src=\"\/blog\/wp-content\/uploads\/2010\/10\/WebBrowserControl1.jpg\" alt=\"\" title=\"WebBrowserControl1\" class=\"aligncenter size-full wp-image-1459\" srcset=\"https:\/\/www.limilabs.com\/blog\/wp-content\/uploads\/2010\/10\/WebBrowserControl1.jpg 467w, https:\/\/www.limilabs.com\/blog\/wp-content\/uploads\/2010\/10\/WebBrowserControl1-300x240.jpg 300w\" sizes=\"(max-width: 467px) 100vw, 467px\" \/><\/p>\n<p>Add MailBrowserControl to the <strong>Toolbox<\/strong>:<\/p>\n<p><img decoding=\"async\" src=\"\/blog\/wp-content\/uploads\/2010\/10\/WebBrowserControl2.jpg\" alt=\"\" title=\"WebBrowserControl1\" class=\"aligncenter size-full wp-image-1459\" \/><\/p>\n<p><img decoding=\"async\" src=\"\/blog\/wp-content\/uploads\/2010\/10\/WebBrowserControl3.jpg\" alt=\"\" title=\"WebBrowserControl1\" class=\"aligncenter size-full wp-image-1459\" \/><\/p>\n<p><strong>Drag and drop<\/strong> the control on to the form.<\/p>\n<p>Then just use <strong>Navigate <\/strong>method:<\/p>\n<pre class=\"brush: csharp; title: ; notranslate\" title=\"\">\r\n\/\/ C# version\r\n\r\nprivate void button1_Click(object sender, EventArgs e)\r\n{\r\n    IMail mail = new MailBuilder().CreateFromEmlFile(@&quot;HTMLMail.eml&quot;);\r\n    mailBrowser1.Navigate(new MailHtmlDataProvider(mail));\r\n}\r\n<\/pre>\n<pre class=\"brush: vb; title: ; notranslate\" title=\"\">\r\n' VB.NET version\r\n\r\nPrivate Sub button1_Click(sender As Object, e As EventArgs) Handles Button1.Click\r\n\tDim mail As IMail = New MailBuilder().CreateFromEmlFile(&quot;HTMLMail.eml&quot;)\r\n\tmailBrowser1.Navigate(New MailHtmlDataProvider(mail))\r\nEnd Sub\r\n<\/pre>\n<p><strong>That&#8217;s it! <\/strong><\/p>\n<p>Note that all images and HTML are loaded from memory, <strong>no temporary files <\/strong> are created.<\/p>\n<p>You can find a working example in the <a href=\"\/mail\">Mail.dll download package<\/a>.<\/p>\n<p><img decoding=\"async\" src=\"\/blog\/wp-content\/uploads\/2010\/10\/WebBrowserControl.jpg\" alt=\"\" title=\"WebBrowserControl1\" class=\"aligncenter size-full wp-image-1459\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>We have a special Windows control to do this &#8211; MailBrowserControl. First you need to add reference to the three assemblies: Mail.dll MailBrowserControl.dll ProtocolEx.dll Add MailBrowserControl to the Toolbox: Drag and drop the control on to the form. Then just use Navigate method: \/\/ C# version private void button1_Click(object sender, EventArgs e) { IMail mail [&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,28,42,57],"class_list":["post-1301","post","type-post","status-publish","format-standard","hentry","category-mail-dll","tag-c","tag-email-component","tag-imap","tag-pop3","tag-vb-net"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/1301"}],"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=1301"}],"version-history":[{"count":4,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/1301\/revisions"}],"predecessor-version":[{"id":4108,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/posts\/1301\/revisions\/4108"}],"wp:attachment":[{"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/media?parent=1301"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/categories?post=1301"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.limilabs.com\/blog\/wp-json\/wp\/v2\/tags?post=1301"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}