Product Reviews

Managing Mail with Aspose.Email for .NET

If you want the flexibility to work with almost any e-mail system -- on the client or the server -- then Aspose.Email is probably your solution.

Every developer has had to work on an application where it made sense to incorporate e-mail. In theory, e-mail should make communicating with users about events in an application easy. After all, e-mail supports sending text and almost any kind of file. It doesn't require a client-side installation. It delivers to everything from desktops to mobile devices, and it's an industry standard. Well, actually, that "industry standard" thing turns out to be only mostly true -- are you working with IMAP or POP3, for instance? As you start working with e-mail (using, for example, the .NET SmtpClient object) you soon find any number of potholes -- potholes that Aspose.Email for .NET is intended to fill.

For instance, while the Microsoft .NET Framework SmtpClient supports sending e-mail, it doesn't provide any mechanism for receiving e-mail. Aspose.Email, on the other hand, allows you to not only send mail through an SMTP server but also to contact POP3 and IMAP mail servers so you can download lists of received messages and process them. The Aspose.Email components also enable you to pick up e-mail by talking to Microsoft Exchange Server. Picking up mail allows you to create "interactive" mail applications in which users can respond to, for instance, notification messages (if only to say, "I got this").

Integrating with Clients
Most users already have an e-mail client on their desktops, and it makes sense to take advantage of the features built into those clients -- adding any e-mails you send to your users' "sent mail" list, for example. However, you can also run into any number of problems using this approach. While Outlook Express (and many other e-mail clients) use the .eml format for storing mail, Outlook uses the .msg format. Opera, on the other hand, uses the .mht format (which supports embedding files in HTML). While Outlook holds data in .pst files, Opera Mail holds its data in the mbox format. (Thunderbird uses a variation of .mbox called .mboxrd). Aspose.Email supports all of these formats.

Unfortunately, Aspose.Email doesn't support these different clients by hiding all their ugly details. Instead, Aspose.Email provides a set of objects for each of the clients. While you'll probably have the objects you need for any particular client (including Thunderbird), if you want to support every client, you'll need to write separate code for each one.

Moving up from the client to the server, Microsoft specifically recommends that you don't do server-side programming with its COM objects, citing issues with security and stability (among other problems). Even with the number of e-mail automation tools around, I found that Aspose.Email support for Outlook and Exchange is especially impressive. It's much easier to process messages in either of those environments with Aspose.Email than using the native COM objects. Creating a bulk mailing, for instance, just requires you to use the Aspose.Email MailMessage class to read an Outlook template file that contains the boilerplate for your message, modify the contents as required for each user and then send it.

And Aspose.Email isn't limited to sending just e-mail -- the product also supports the iCalendar format. You can use this format (an industry standard) to attach scheduled events to the e-mails that you send and be reasonably confident that the appointment will pop up in the recipient's schedule.

More Cool Stuff
Beyond working with e-mail, I kept stumbling across cool stuff in the package. The FileDropTargetManager, for instance, lets you create Windows Forms controls (such as Panels) that can accept items dragged from Outlook. Pre-packaged UI controls aren't included, however. You'll have to write the code to extend existing controls yourself.

There's nothing really wrong with the documentation that comes with Aspose.Email, but there's not a great deal that's right. The documentation is primarily organized by namespaces and classes rather than by task. The task-based documentation consists almost exclusively of commented code examples. There seems to be some confusion about the audience, though, because some of the task guides consist primarily of step-by-step instructions (with graphics!) on how to add a project reference to the necessary Aspose libraries -- you'd think Aspose could assume that anyone using its product would know how to do that.

Documentation aside, if you're looking to integrate e-mail into your applications, Aspose.Email lets you do just about anything you want, and it offers you the flexibility to work with different e-mail systems.

Aspose

Web: aspose.com
Phone: 888-277-6734
Price: Starts at $599 for a Developer Small Business license with standard support; goes up to $11,987 for a Site OEM license with enhanced support
Quick Facts: A set of .NET libraries for creating e-mail applications
Pros: Supports every e-mail protocol and scenario that a developer would need
Cons: No UI or toolbox components -- ­be prepared to write code



About the Author

Peter Vogel is a system architect and principal in PH&V Information Services. PH&V provides full-stack consulting from UX design through object modeling to database design. Peter tweets about his VSM columns with the hashtag #vogelarticles. His blog posts on user experience design can be found at http://blog.learningtree.com/tag/ui/.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube