I have an Outlook add-in which assigns a UserProperty to a MailItem before it is sent:
Outlook.UserProperty prop = mail.UserProperties.Add("XXXX", Outlook.OlUserPropertyType.olText);
prop.Value = "YYYY";
It is known (see Stop Outlook from converting HTML to RTF for example) that doing this causes the email to be sent using TNEF (ie RTF format, the dreaded winmail.dat).
My question is, is it safe to simply un-set the TNEF property? The following code will do that:
mail.PropertyAccessor.SetProperty("http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/8582000B", false);
The issue here is that I have to do this on ItemSend
- I can't do it straight after I set the property, because it's always false
anyway at that point. It only turns true
when I hit Send.
I don't mind the fact that un-setting the TNEF property will mean that the property does not get sent with the email. I am more concerned that there may be other situations where TNEF is actually required and that this code would break them.
Or alternatively, is there a better way altogether of "tagging" an email with a custom ID number before it is sent?