GroupDocs.Metadata for .NET 25.2 Release Notes

Major Features

There are the following features, enhancements, and fixes in this release:

  • Modify MSG fields and attachments

Full List of Issues Covering all Changes in this Release

KeySummaryCategory
METADATANET-4121Modify MSG fields and attachments.New Feature

Public API and Backward Incompatible Changes

Public API changes

New class MsgAttachmentPackage has been added to the GroupDocs.Metadata.Formats.Email namespace

New fields BodyHtml BodyRtf InternetMessageId has been added to the MsgPackage class

Use cases

Modify MSG fields and attachments

var name = "tree.jpg";
var attachmentPath = Constants.AttachmentJpg;
byte[] bytes;
using (Metadata metadata = new Metadata("input.msg"))
{
	var root = metadata.GetRootPackage<MsgRootPackage>();
	using (FileStream fsSource = new FileStream(attachmentPath,
			   FileMode.Open, FileAccess.Read))
	{
		bytes = new byte[fsSource.Length];
		var attachments = new MsgAttachmentPackage[1];
		attachments[0] = new MsgAttachmentPackage(name, bytes);
		root.EmailPackage.Attachments = attachments;
	}
	metadata.Save();
}