{"id":47,"date":"2008-04-06T13:45:57","date_gmt":"2008-04-06T18:45:57","guid":{"rendered":"http:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/47"},"modified":"2008-04-06T13:45:57","modified_gmt":"2008-04-06T18:45:57","slug":"smtp-component-for-net-recommendation","status":"publish","type":"post","link":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/47","title":{"rendered":"SMTP Component for .NET Recommendation"},"content":{"rendered":"

I’ve been relying on the MailBee.NET SMTP Component<\/a> from AfterLogic for several months now and just wanted to recommend it to anyone needing a SMTP component for your .NET development. It’s inexpensive and easy to use:<\/p>\n

Pop3 <\/span>pop = new <\/span>Pop3<\/span>();\ntry\n<\/span>{\n    pop.Connect(emailPop3Server, 110);\n    if <\/span>(_quitting) { return<\/span>; }\n\n    pop.Login(emailAccountName, emailPassword, AuthenticationMethods<\/span>.Auto);\n    if <\/span>(_quitting) { return<\/span>; }\n\n    MailMessageCollection <\/span>msgs = pop.DownloadEntireMessages();\n    foreach <\/span>(MailMessage <\/span>m in <\/span>msgs)\n    {\n        try\n        <\/span>{\n            if <\/span>(m.HasAttachments)\n            {\n                foreach <\/span>(Attachment <\/span>attach in <\/span>m.Attachments)\n                {\n                    if <\/span>(attach.ContentType == "image\/jpeg"<\/span>)\n                    {\n                        using <\/span>(MemoryStream <\/span>memStream = new <\/span>MemoryStream<\/span>(attach.GetData()))\n                        {\n                            Image <\/span>img = Image<\/span>.FromStream(memStream);\n\n                            if <\/span>(_quitting) { return<\/span>; }\n\n                            using <\/span>(MemoryStream <\/span>compressedJPG = BuildJPGWithCompressionSetting(img, 60))\n                            {\n                                \/\/ the filename doesn't need to be meaningful, and would be better if it weren't to prevent conflicts!\n                                <\/span>string <\/span>newFileName = string<\/span>.Format("{0}.jpg"<\/span>, Guid<\/span>.NewGuid());\n                                Upload(compressedJPG, ftpSite + newFileName, ftpAccountName, ftpPassword);\n                            }\n                        }\n                    }\n                    if <\/span>(attach.ContentType == "multipart\/related"<\/span>)\n                    {\n                        \/\/MimePart mp = attach.AsMimePart;\n                        \/\/MimePartCollection mpc = mp.GetAllParts();\n                    <\/span>}\n                } \/\/ thru each attachment\n            <\/span>} \/\/ has attachement?\n        <\/span>}\n        finally\n        <\/span>{\n            m.Dispose();\n        }\n    }   \/\/ loop thru all the messages\n<\/span>}\nfinally\n<\/span>{\n    if <\/span>(pop != null<\/span>)\n    {\n        pop.DeleteMessages();\n        pop.Disconnect();\n        pop = null<\/span>;\n    }\n}<\/pre>\n

<\/a><\/p>\n

The above code is used in a Windows Service I’ve written to automatically connect to a specific e-mail address, download the messages, and automatically upload the attached images to an FTP Server (I’ve removed some of the security checks that my code does).<\/p>\n

You can see though in the code how easy it is to use the component. It takes the pain out of doing SMTP development and handles a wide variety of cases that might exist (there are multiple techniques for attaching images for example). <\/p>\n

I purchased the Single Developer License at $69 — which is a license for unlimited use of the component by me. <\/p>\n

They also have a set of components for IMAP, POP3 and security available individually or as a package deal (although it wasn’t clear the package was necessarily as good a price). <\/p>\n

AfterLogic<\/a> has a 30 day trial available for all of their components.<\/p>\n

Recommended.<\/p>\n","protected":false},"excerpt":{"rendered":"

I’ve been relying on the MailBee.NET SMTP Component from AfterLogic for several months now and just wanted to recommend it to anyone needing a SMTP component for your .NET development. It’s inexpensive and easy to use: Pop3 pop = new Pop3(); try { pop.Connect(emailPop3Server, 110); if (_quitting) { return; } pop.Login(emailAccountName, emailPassword, AuthenticationMethods.Auto); if (_quitting) […]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[4],"tags":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pd5QIe-L","jetpack_likes_enabled":true,"jetpack-related-posts":[{"id":1216,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/1216","url_meta":{"origin":47,"position":0},"title":"Sending an email using SMTP in .NET 4.0","date":"July 13, 2011","format":false,"excerpt":"I had need of sending embedded images within an e-mail. .NET has had a few handy classes for sending an email using SMTP for a few versions. While there were a few examples floating around the internet, none were as clean and easy to follow as I expected. So, I\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":263,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/263","url_meta":{"origin":47,"position":1},"title":"Dead Weight APIs?","date":"May 11, 2008","format":false,"excerpt":"What's the Perfect API? I came across this by complete chance this afternoon... from Jon Skeet, \"Critical dead-weight.\" \"We're all familiar with the idea of a technology achieving critical mass: having enough users (subscribers, customers, whatever the appropriate metric might be) to keep it alive and useful. This morning I\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1597,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/1597","url_meta":{"origin":47,"position":2},"title":"Paging Data with SQL Server Compact","date":"April 1, 2012","format":false,"excerpt":"If you\u2019re using SQL Server Compact Editition version 4 or higher, there\u2019s finally a decent and efficient way to do data paging: var streets = db.Query(@\"SELECT * FROM StreetNames ORDER BY Id OFFSET @offset ROWS FETCH NEXT @rows ROWS ONLY\", new { offset = group * GroupSize, rows = GroupSize\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/www.wiredprairie.us\/blog\/wp-content\/uploads\/2012\/04\/image9.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1800,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/1800","url_meta":{"origin":47,"position":3},"title":"Named routing with Knockout, ASP.NET MVC, and AttributeRouting, from JavaScript","date":"January 24, 2013","format":false,"excerpt":"It's hard to describe exactly what I've built here, but I'm just throwing these pieces out on the Internet in case someone: a) finds them useful, or b) has a better solution. Goals: Named routes, with a wee bit of a Rails feel A Knockout friendly syntax for binding to\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":688,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/688","url_meta":{"origin":47,"position":4},"title":"Calculating the distance between two Zip Codes in C#","date":"January 24, 2009","format":false,"excerpt":"How far is it from the USA Zip code 90210 to 73487 (by drawing a line, not by driving)? Unfortunately, there are many classes built into the .NET framework, but a zip code distance calculator isn\u2019t included. So, you\u2019d be forced to roll your own if you want to programatically\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"","src":"https:\/\/i0.wp.com\/www.wiredprairie.us\/blog\/wp-content\/uploads\/2009\/01\/image17.png?resize=350%2C200","width":350,"height":200},"classes":[]},{"id":1524,"url":"https:\/\/www.wiredprairie.us\/blog\/index.php\/archives\/1524","url_meta":{"origin":47,"position":5},"title":"Alternative to ApplicationSettings in .NET","date":"February 1, 2012","format":false,"excerpt":"After dealing with lost settings, an unclear upgrade path, and my own confusion surrounding the magic of Settings in a .NET client application, I decided to build my own. You\u2019re probably familiar with this UI in Visual Studio. It hasn\u2019t changed much since it was first created: A list of\u2026","rel":"","context":"In "Coding"","img":{"alt_text":"image","src":"https:\/\/i0.wp.com\/www.wiredprairie.us\/blog\/wp-content\/uploads\/2012\/02\/image.png?resize=350%2C200","width":350,"height":200},"classes":[]}],"_links":{"self":[{"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/posts\/47"}],"collection":[{"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/comments?post=47"}],"version-history":[{"count":0,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/posts\/47\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/media?parent=47"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/categories?post=47"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wiredprairie.us\/blog\/index.php\/wpjson\/wp\/v2\/tags?post=47"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}