Browse our Products

Aspose.Email for CPP 23.4 Release Notes

Aspose.Email for C++ 23.4 is based on Aspose.Email for .NET 23.3.

Aspose.Email for C++ does not support asyncronic features of e-mail protocols

New Features

Provide method to get Get Total Items Count of PersonalStorage

We have added the GetTotalItemsCount() method to OlmStorage class. It returns the total number of message items contained in the OLM storage.

Code example:

auto olm = System::CreateObject<OlmStorage>(u"storage.olm")
auto count = olm->GetTotalItemsCount();

How to determine if MapiMessage is OFT or MSG

OFT (Outlook File Template) file is an email template created by Microsoft Outlook. MapiMessage also supports loading it using the Load method. But having a MapiMessage object it is difficult to determine whether it was loaded from an OFT or MSG file, as OFT file format uses the MSG file format at its base. We have added the MapiMessage::get_IsTemplate() property, which allows us to determine whether the MapiMessage was loaded from an OFT or MSG file.

Code example:

auto msg = MapiMessage::Load(u"message.msg");
auto isOft = msg->get_IsTemplate(); // returns false

auto msg = MapiMessage::Load(u"message.oft");
auto isOft = msg->get_IsTemplate(); // returns true

Also, we have added a new ways to save MapiMessage or MailMessage in OFT format, with using SaveOptions:

// Save the MailMessage to OFT format
auto eml = MailMessage::Load(u"message.eml")
eml->Save(u"message.oft", SaveOptions::get_DefaultOft());

// or alternative way #2
auto saveOptions = System::CreateObject<MsgSaveOptions>(MailMessageSaveType::get_OutlookTemplateFormat());
eml->Save(u"message.oft", saveOptions);

// or alternative  way #3
saveOptions = SaveOptions::CreateSaveOptions(MailMessageSaveType::get_OutlookTemplateFormat());
eml->Save(u"message.oft", saveOptions);

// Save the MapiMessage to OFT format
auto msg = MapiMessage::Load(u"message.msg");

msg->Save(u"message.oft", SaveOptions::get_DefaultOft());

// or alternative way #2
auto saveOptions = System::CreateObject<MsgSaveOptions>(MailMessageSaveType::get_OutlookTemplateFormat());
msg->Save(u"message.oft", saveOptions);

// or alternative  way #3
auto saveOptions = SaveOptions::CreateSaveOptions(MailMessageSaveType::OutlookTemplateFormat);
msg->Save(u"message.oft", saveOptions);
}

Detect an NSF File Format

We have added a feature to recognize the NSF file format:

auto formatType = FileFormatUtil::DetectFileFormat(u"storage.nsf")->get_FileFormatType(); // Returns FileFormatType.Nsf

The full code of the examples can be found at Aspose Email for C++ GitHub examples repository.