Rendering Outlook VCard Contact to MHTML with Aspose.Email for .NET 17.3.0

Share on FacebookTweet about this on TwitterShare on LinkedIn

We are pleased to announce the release of Aspose.Email for .NET 17.3.0. This month’s release includes enhancements and bug fixes that enriches the API functionality and adds stability to the API behavior. As mentioned earlier, we have also stopped publishing the legacy version of the API and the revamped version with improved namespace will be published from now onwards. For a detailed note on what is new and fixed, please visit the release notes section of Aspose.Email for .NET documentation.


Rendering VCard Information to MHTML: This month’s release provides the capability to render Microsoft Outlook VCard contact information to MHTML. This can be achieved with MhtFormatOptions.RenderVCardInfo enumerator while saving the message to MHTML. Previously, only headers information was rendered to output while rendering the respective values was not supported. The following code sample gives an illustration of how to use this feature.

//Load VCF Contact and convert to MailMessage for rendering to MHTML
MapiContact contact = MapiContact.FromVCard(dataDir + "Contact.vcf");

MemoryStream ms = new MemoryStream();
contact.Save(ms, ContactSaveFormat.Msg);
ms.Position = 0;
MapiMessage msg = MapiMessage.FromStream(ms);
MailConversionOptions op = new MailConversionOptions();
MailMessage eml = msg.ToMailMessage(op);

//Prepare the MHT format options
MhtSaveOptions mhtSaveOptions = new MhtSaveOptions();
mhtSaveOptions.CheckBodyContentEncoding = true;
mhtSaveOptions.PreserveOriginalBoundaries = true;
MhtFormatOptions formatOp = MhtFormatOptions.WriteHeader | MhtFormatOptions.HideExtraPrintHeader | MhtFormatOptions.RenderVCardInfo;
mhtSaveOptions.MhtFormatOptions = formatOp;
eml.Save(dataDir + "ContactMhtml.mhtml", mhtSaveOptions);

Support for Email Threading: Aspose.Email API already supported creating reply and forwarding messages using the MailMessage class. However, this didn’t support creating a thread between the original and replied email. This month’s release provides the capability to create threading among the original emails and the replies sent out using Aspose.Email API.

Other Improvements

Like always, we have also fixed several bugs in this month’s release that were reported by our valued customers with different API functionality. This further adds stability to the API functionality and makes the output predictable.

API Resources

The following API resources can be of help to you in getting started with Aspose.Email API.