Nuget Nuget GitHub

C++ Email Library

Aspose.Email for C++ is a complete set of Email Processing APIs to create, read and manipulate emails from within C++ applications. It makes it easier to work with many Outlook email message formats such as MSG, EML, EMLX and MHT files without the need of installing Microsoft Outlook. It also enables you to manage message storage files - Personal Storage Files (PST), Offline Storage Files (OST) along with message sending and receiving capabilities. You can also read and extract Outlook PST file that can be saved to disk in MSG format.

Directory Description
Examples A collection of C++ examples that help you learn the product features.

Email Message Parsing via C++

Read & Write Email Formats

Microsoft Outlook: MSG, PST, OST, OFT
Other: EML, EMLX, MBOX, ICS, VCF, HTML, MHTML

Read Only Email Formats

Microsoft Outlook: OLM

Gett Started with Aspose.Email for C++

Are you ready to give Aspose.Email for C++ a try? Simply execute Install-Package Aspose.Email.Cpp from Package Manager Console in Visual Studio to fetch the NuGet package. If you already have Aspose.Email for C++ and want to upgrade the version, please execute Update-Package Aspose.Email.Cpp to get the latest version.

Create New Message & Save in EML & MSG Formats

// create a new instance of MailMessage class
System::SharedPtr<MailMessage> message = System::MakeObject<MailMessage>();

// set subject of the message
message->set_Subject(u"New message created by Aspose.Email for .NET");

// set HTML body
message->set_IsBodyHtml(true);
message->set_HtmlBody(u"<b>This line is in bold.</b> <br/> <br/><font color=blue>This line is in blue color</font>");

// set sender information
message->set_From(u"from@domain.com");

// add TO recipients
message->get_To()->Add(u"to1@domain.com");
message->get_To()->Add(u"to2@domain.com");

// add CC recipients
message->get_CC()->Add(u"cc1@domain.com");
message->get_CC()->Add(u"cc2@domain.com");

// save message in EML, MSG and MHTML formats
message->Save(dir + u"output.eml", Aspose::Email::SaveOptions::get_DefaultEml());
message->Save(dir + u"output.msg", Aspose::Email::SaveOptions::get_DefaultMsgUnicode());

Send Email via Exchange EWS Client

// create instance of IEWSClient class by giving credentials
System::SharedPtr<IEWSClient> client = GetExchangeEWSClient(GetExchangeTestUser());

// create instance of type MailMessage
System::SharedPtr<MailMessage> msg = System::MakeObject<MailMessage>();
msg->set_From(MailAddress::to_MailAddress(u"sender@domain.com"));
msg->set_To(MailAddressCollection::to_MailAddressCollection(u"recipient@ domain.com "));
msg->set_Subject(u"Sending message from exchange server");
msg->set_HtmlBody(u"<h3>sending message from exchange server</h3>");

// send the message
client->Send(msg);

Home | Product Page | Docs | Demos | API Reference | Examples | Blog | Search | Free Support | Temporary License