mailItem.UserProperties need to be removed when item send?

Add-in Express™ Support Service
That's what is more important than anything else

mailItem.UserProperties need to be removed when item send?
 
Byung Kun Kim




Posts: 48
Joined: 2011-12-15
I'm saving some temporary data to mailItem.UserProperties.

Maybe I had read somewhere before that saving custom data into mailItem.UserProperties gets problem, when some kind of mail server received this type of mailitem(sort of TNEF?),

Is it better to remove my temp data from UserProperties when mailitem.Send?

Would you recommend good article about it, maybe on your site?
Posted 28 Nov, 2016 16:00:27 Top
developer_cp




Posts: 47
Joined: 2016-10-28
If you are composing a fresh email, you probably don't need to put anything in UserProperties.
I guess your case is when you are replying email, and it pulls from the existing MailItem with custom UserProperties?

With my own experience of working with Outlook in the past few weeks (nightmare-ish).
I've been having hard time playing and saving custom data in UserProperties, in the end, I end up just restructured my code to only modify the MailItem ONCE in order to avoid the MAPI_E_OBJECT_CHANGE.

IMHO, is probably better not to include any custom stuff...
Posted 28 Nov, 2016 16:59:41 Top
Andrei Smolin


Add-in Express team


Posts: 14094
Joined: 2006-05-11
Hello Byung and thank you, Eric!

It is recommended to remove user properties before you send an email. This is a common knowledge that you can google out; see e.g. https://www.google.com/search?q=UserProperty+tnef&ie=utf-8&oe=utf-8.

See e.g. the recommendation from Dmitry Streblechenko (an Outlook and Extended MAPI guru, the author of Outlook Spy and Outlook Redemption) at https://social.msdn.microsoft.com/Forums/en-US/19f0b71a-e538-4629-b4f1-0aeaeff4ee33/entryid-on-mailitem-object?forum=outlookdev:

If you add a user property, your message will be sent in the TNEF format. To avoid that, add a named MAPI property using MailItem.PropertyAccessor instead.


Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 29 Nov, 2016 06:04:43 Top