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.
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
Peter Vogel is a principal in PH&V Information Services, specializing in ASP.NET development with expertise in SOA, XML, database, and user interface design. His most recent book ("rtfm*") is on writing effective user manuals, and his blog on technical writing can be found at rtfmphvis.blogspot.com.