Hello Support Team,
I’ve a licence for an old Aspose version, and have this problem. So before buying the licence for latest version, I’ve tested with latest version using a test projet and nuget package, and have the same behavior.
I’m trying to put some custom property in a MSG file, then open this MSG (using Outlook) and check if Outlook can see this property. I make this check using Outlook Spy, and it doesn’t see the property.
Could you tell me what’s wrong with my code ?
My Real Use case is :
- Downloading MSG file from our server
- Using Aspose, updating standard and custom properties, then save the file
- Open the email (=> Outlook)
- When the user send the mail, an add-in intercept the send and check the custom property ==> No custom property is visible.
My Test use case (full code in attachment)
- Using aspose, open and update the email subject, add a custom property “TestingCustomProp” with value “123456”, then save the email
- Open the email (=> Outlook)
- Check the subject and custom property
- For the subject, the change is correctly done
- For the custom prop, using Outlook spy this custom prop is not visible
Could you tell me what’s wrong ?
I set the custom property using this code:
static void setProp(MapiMessage mail, string name, string value)
{
var property = new MapiProperty(
mail.NamedPropertyMapping.GetNextAvailablePropertyId(MapiPropertyType.PT_UNICODE),
Encoding.Unicode.GetBytes(value));
mail.AddCustomProperty(property, name);
}
I’ve put my complete test project + email sample in attachment
AsposeTests.zip (18.0 KB)
Thank you for your help,
Fabrice