HomeCommunityControl GalleryMiscellaneousEmailAspose.Email for .NET

Aspose.Email for .NET



Submit a Review

1 Downloads

1,718 Views


Description

Overview

Aspose.Email for .NET is a collection of components for working with email from within ASP.NET web applications, web services or Windows applications. It makes it easy to work with Outlook PST, EML, MSG and MHT files. Aspose.Email makes it easy to work with HTML or plain text emails and their attachments. It allows developers to work against SMTP, POP, FTP and Microsoft Exchange servers. It supports mail merge and iCalendar features, customized header and body, retrieving content, header information and embedded files, Twitter and much more. Aspose.Email for .NET allows developers to focus on implementing their business logic and managing emails without having to get into the nitty-gritty of email and network programming. Our file format expertise ensures that the components are easy to use and give you the controls you need to perform your tasks.

Network programming

Aspose.Network for .NET is a free utility that supports most major network protocols and contains utility classes for common development tasks. The features in Aspose.Email and Aspose.Network were maintained as one product until September 2011.

A Complete Email Processing Solution

Aspose.Email for .NET allows you to quickly send emails using just two lines of code. With Aspose.Network for .NET you can easily create and send emails through SMTP Servers, attach embedded objects and add attachments to emails, include text and/or HTML mail body, mail merge for creating emails from a template, send bulk emails, and send iCalendar compliant appointments or meetings as well as create customized mail headers. Aspose.Email for .NET also allows you to log into POP3 servers by user and password or APOP authentication, view mailbox size and messages count, retrieve the full message or its header, delete messages etc

Syntax Example

In this section, we will read the Outlook PST file and extract messages and save to disk in MSG format. We will use the recursive method to browse all the folders (including nested folders) and call the PersonalStorage.GetMessage() method to get the Outlook message in an instance of MapiMessage class. After that MapiMessage.Save() method will be called to save the message to either disk or stream in MSG format. [C#] using System; using Aspose.Email.Outlook.Pst; using Aspose.Email.Outlook; using System.Diagnostics; using System.IO; namespace PSTExtractMsg { class Program { static void Main(string[] args) { try { Console.WriteLine("Loading PST file...."); PersonalStorage pst = PersonalStorage.FromFile(@"PersonalFolders.pst") Console.WriteLine("Display Name: " + pst.DisplayName); FolderInfo folderInfo = pst.RootFolder; ExtractMsgFiles(folderInfo, pst); } catch (Exception ex) { Console.WriteLine(ex.Message); Debug.WriteLine(ex.Message); } Console.WriteLine("Press any key to exit...."); Console.ReadKey(); } private static void ExtractMsgFiles(FolderInfo folderInfo, PersonalStorage pst) { Console.WriteLine("Folder: " + folderInfo.DisplayName); Console.WriteLine("=================================="); MessageInfoCollection messageInfoCollection = folderInfo.GetContents(); foreach (MessageInfo messageInfo in messageInfoCollection) Console.WriteLine("Saving message {0} ....", messageInfo.Subject); MapiMessage message = pst.GetMessage(messageInfo); message.Save(message.Subject.Replace(":", " ") + ".msg"); MemoryStream messageStream = new MemoryStream(); message.Save(messageStream); if (folderInfo.HasSubFolders == true) { foreach (FolderInfo subfolderInfo in folderInfo.GetSubFolders()) {ExtractMsgFiles(subfolderInfo, pst); } } } } }

Screenshots

Reviews

Submit a review