Is it possible to modify mail items, in the 'Sent Items' Folder?

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

Is it possible to modify mail items, in the 'Sent Items' Folder?
 
Bjørn Rasmussen




Posts: 4
Joined: 2017-09-06
I have made an Add-In, which in the ItemSend event, adds an attachment (xml-file) before sending the email.

The attachment contains metadata for the public 'Digital Post' platform, used to deliver messages to citizens in DK.
The metadata contains - among other things, the SSN of the recipient.

For GDPR reasons I want to mask the digits of the SSN in the attached metadata file, after the mail has arrived in the 'Sent Items' folder.

Is it possible, in the 'Send Items' folder, to replace the attached metadata file with a new modified metadata file where the SSN is masked.

Thanks,

Bjørn
Posted 22 Apr, 2020 03:30:39 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Hello Bjørn,

This will work. I expect that Outlook will display that email as non-sent, though. Don't know if this is okay with you.

Also pay attention to the scenario where I tried to modify an email in the ItemAdd event of the Sent Items folder: https://www.add-in-express.com/creating-addins-blog/2020/02/26/solve-synchronization-conflict-when-modifying-outlook-item-itemadd-event/.

Maybe you need to prevent that email from getting saved to Sent Items at all?


Andrei Smolin
Add-in Express Team Leader
Posted 22 Apr, 2020 03:52:14 Top
Bjørn Rasmussen




Posts: 4
Joined: 2017-09-06
Thank you for your reply, Andrei

It could be a problem, that the mail appears to be non-sent. - Depending on the users.

It is possible to prevent the mail from being saved at all, after sending?

Or is it just the possibility to choose another folder?

Would it be possible for my Add-In to create a folder that it can use only for saving mails sent by the Add-In, or is it only possible to address 'well-known' folder names as the location for sent mail?


Best regards,

Bjørn
Posted 22 Apr, 2020 05:25:11 Top
Andrei Smolin


Add-in Express team


Posts: 18829
Joined: 2006-05-11
Hello Bjørn,

Bjørn Rasmussen writes:
It is possible to prevent the mail from being saved at all, after sending?


I would try to set MailItem.SaveSentMessageFolder = null (Nothing in VB.NET) to prevent creating a copy of the email sent.

Bjørn Rasmussen writes:
Would it be possible for my Add-In to create a folder that it can use only for saving mails sent by the Add-In


Yes. Set MailItem.SaveSentMessageFolder = {an Outlook.MAPIFolder object representing that folder}. I know that you can change that property in the ItemSend event.


Andrei Smolin
Add-in Express Team Leader
Posted 22 Apr, 2020 05:30:07 Top