Send Mail Exception Catching

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

Send Mail Exception Catching
 
BerndH




Posts: 55
Joined: 2014-09-23
I made wrong settings in outlook regarding certificate and digital signing (yes I can...)

Without my add-in:
If I answer a mail from a friend, which has a signature, Outlook failed with an error and my mail is still there in compose mode. I can "create" error -2146893823 and -2147467259 ...

WITH my add-in:
I do some things (adding special headers etc.) with the mail in the adxOutlookEvents_ItemSend.
If I come up to mi.save() - Mi is my OutlookMailItem - I got an exception. I catch it, set e.Cancel = true and leave the method. But the mail is gone. Not in compose mode and not in the draft folder.

Do you know how I can prevent the lost of my mail?
Posted 06 Nov, 2020 09:27:47 Top
Andrei Smolin


Add-in Express team


Posts: 17493
Joined: 2006-05-11
Hello Bernd,

-2146893823 stands for 0x80090001; see Bad UID at https://docs.microsoft.com/en-us/windows/win32/com/com-error-codes-4.

-2147467259 stands for 0x80004005; see E_FAIL at https://docs.microsoft.com/en-us/windows/win32/com/com-error-codes-1.

I'd try to set e.Cancel=true before the save and restore e.Cancel=false if the save doesn't fail.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 06 Nov, 2020 09:42:17 Top
BerndH




Posts: 55
Joined: 2014-09-23
Oh I just found out, my catch works well, if the mail is composed and sended in "undocked composer". If I write mails "docked in" the mail disappears.
Posted 06 Nov, 2020 10:06:15 Top