Zip gets corrupt after attaching and sending via vsto in online mode (VSTO, Office 2016, Exchange 2016, C#) RRS feed

  • Question

  • Hi,

    we have an vsto addin which, with a click on a button, saves the attachments, zip them and reattaches the zip to the mail. After this it sends the mail with MailItem.Send();

    This used to work fine but we have a strange issue with one of our customers.

    He uses Office 2016 on Terminal Server with online mode and has an Exchange 2016.

    If he sends e.g. 3 times the same mail with the addin one of these mails has just an empty zip attached without any files in it.

    We debugged the process and the zip is correctly attached in the mail (all files show up and you can open the files in the zip) before sending with MailItem.Send().

    After sending the mail the zip has only 4kb and has no files in it (mail in sent items and also the received mail). If I download the zip to the desktop the size on disk is zero.

    This only happens in online mode not in cached mode.

    If you open the zip manually before sending, the zip does not get corrupted after sending.

    This also happens if we do not use mailitem.send() but the customer sends manually after the zip is attached by the addin.

    It seems that in online mode the exchange server is aware of the zip but fails to upload the zip to the mail and only sends an empty container. The strange thing is that it works sometimes and sometimes not.

    In the code we release all outlook objects with marshal.releasecomobject.

    At the moment I really don't know what this could be. For sure it has to do something with the customers infrastructure because with other customers the problem never occurred.

    Does anyone have any idea what this could be, any similar experience or idea where to look (logs etc.)?

    Thank you very much


    Regards Mark

    • Edited by Wompi Friday, August 3, 2018 8:08 AM
    Friday, August 3, 2018 8:03 AM

All replies

  • Hello Wompi,

    What's the related code? Could anyone else could reproduce the issue?

    What do you mean online mode? Will the issue still occur on "off-line" mode?

    Best Regards,


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact

    Monday, August 6, 2018 1:58 AM
  • Hi Terry,

    I am very sorry for the late response.

    Basically the code just adds an attachment (in our case a zip file) and then sends the mail. I will try to create an addin with only the basic add attachment code and test this on the customers site if the problem still persists. 

    Until now it is only this customer who has this problem. By online mode I mean if you disable exchange cached mode. In cached mode the problem does not occur.

    So basically the problem is that when sending emails with attachments manually added in outlook online mode (not cached mode) the attachment will be empty in sent items and on the receiver site. It seems that there is a file attached but this file is empty.

    Thank you

    Regards Mark

    • Edited by Wompi Wednesday, September 12, 2018 1:48 PM
    Wednesday, September 12, 2018 1:47 PM