Cancel the submission, save the message, read its entry id. Start a separate thread to do the processing (do not touch the OOM in that thread!). When the secondary thread finishes, run on the main thread code that will reopen the item by its entry id and modify the attachments, send the message again. ItemSend even will fire again, but you can ignore it this time (custom property or flag?).
UPDATE (2019) - keep in mind that Outlook 2016 or newer raises an exception as soon as it detects access on a secondary thread. If you need to touch OOM, you can only do that on the main thread in your addin. If you need to access any Outlook data on the secondary thread, you can only use Extended MAPI (C++ or Delphi) or Redemption (any language, I am its author - the RDOSession object can be accessed on a secondary thread: save the value of the Namespace.MAPIOBJECT
property in a dedicated variable, then on a secondary thread create a new instance of RDOSession
- that will initialize the MAPI system on that thread - and set the RDOSession.MAPIOBJECT
property to the value saved on the secondary thread).