Possible to load in an email in MSG file format, modify content of selected attachments, save back as MSG file?

Okay, my bad - it does allow setting the property value.

Now, testing with simple MSG files attached:

asposetest.zip (107.8 KB)
test.zip (40.5 KB)

With simple code as follows, i.e. just loading the MSG file and then saving it right back:

            using Metadata metadata = new(msgFile);
            MsgRootPackage root = metadata.GetRootPackage<MsgRootPackage>();
            MsgPackage msg = root.EmailPackage;
            metadata.Save();

For the 1st MSG test file, the above causes the MSG content to become messed up.

For the 2nd MSG test file, the Save fails with exception:

Error: The data of attachment can’t be null.
Parameter name: data
at Aspose.Email.Mapi.MapiAttachmentCollection.Add(String name, Byte[] data)
at GroupDocs.Metadata.Formats.Email.MsgRootPackage.(MsgPackage )
at GroupDocs.Metadata.Formats.Email.MsgRootPackage.pfq4rhh3tnxzrhuh6z5nyqfxm3nvff3j?? ?(Stream )

@jarrodwee

Can you please clarify if you were using GroupDocs.Metadata or GroupDocs.Total in this case?

GroupDocs.Metadata.NETFramework 25.3

@jarrodwee

Thank you for the update. We’re looking into this issue.

Any updates on this issue?

Noticed that with GroupDocs.Total.NETFramework 25.7, the original HTML Body is not retained when simply calling Save - it appears to have been simplified and embedded images are missing.

Also noticed that the PR_SENT_REPRESENTING_NAME_W property changed from simply “Jarrod Wee” to “Jarrod Wee </O=EXCHANGELABS/OU=EXCHANGE…>”

@jarrodwee

As I can see all the issues linked to this topic were resolved. Can you please clarify what code you’re running and what source file is used?

Samples and source code in my post above dated 9th April.

@jarrodwee

Got it, thank you! Will take a look and update you.