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

  • AI for GitHub Collaboration? Maybe Not So Much

    No doubt GitHub Copilot has been a boon for developers, but AI might not be the best tool for collaboration, according to developers weighing in on a recent social media post from the GitHub team.

  • Visual Studio 2022 Getting VS Code 'Command Palette' Equivalent

    As any Visual Studio Code user knows, the editor's command palette is a powerful tool for getting things done quickly, without having to navigate through menus and dialogs. Now, we learn how an equivalent is coming for Microsoft's flagship Visual Studio IDE, invoked by the same familiar Ctrl+Shift+P keyboard shortcut.

  • .NET 9 Preview 3: 'I've Been Waiting 9 Years for This API!'

    Microsoft's third preview of .NET 9 sees a lot of minor tweaks and fixes with no earth-shaking new functionality, but little things can be important to individual developers.

  • Data Anomaly Detection Using a Neural Autoencoder with C#

    Dr. James McCaffrey of Microsoft Research tackles the process of examining a set of source data to find data items that are different in some way from the majority of the source items.

  • What's New for Python, Java in Visual Studio Code

    Microsoft announced March 2024 updates to its Python and Java extensions for Visual Studio Code, the open source-based, cross-platform code editor that has repeatedly been named the No. 1 tool in major development surveys.

Subscribe on YouTube