Recipients.ResolveAll() returns true, but I get "Cannot resolve recipient" when sending a mailitem from my Add-In
Category: outlook for developers
Aaron M. Hawryluk on Mon, 03 Oct 2016 19:09:43
I'm working on a pre-existing piece of Outlook add-in code.
When I run Recipients.ResolveAll(), it returns true. Immediately afterward, I try to send the email and get the following error:
The operation failed. The messaging interfaces have returned an unknown error. If the problem persists, restart Outlook. Cannot resolve recipient.
Any ideas as to what I can do to try to debug this and find out what specifically is blocking the send?
Dmitry Streblechenko _MVP_ on Mon, 03 Oct 2016 19:31:46
Does this happen for a particular recipient only? If you save the message instead of sending, does recipient list look Ok in MFCMAPI or OutlookSpy (click IMessage button)?
Eugene Astafiev on Mon, 03 Oct 2016 19:37:57
Do you get the same error when you try to do it manually? What code do you use for sending emails in Outlook?
Aaron M. Hawryluk on Mon, 03 Oct 2016 19:53:32
It happens for all recipients. Looks like there are problems with the recipient entries. I saved a draft and loaded it up in MFCMAPI and got the following:
Dmitry Streblechenko _MVP_ on Mon, 03 Oct 2016 19:56:10
Yep, the recipient is not resolved - only PR)DSIPALY_NAME is present, PR_ENTRYID and PR_EMAIL_ADDRESS are nto there.
Can you try to call Recipient.Resolve instead?
Aaron M. Hawryluk on Mon, 03 Oct 2016 20:52:30
I'll try swapping the routine to loop through the recipients and use Resolve() instead of ResolveAll() and see what happens.
Deepak Saradkumar Panchal on Tue, 04 Oct 2016 01:34:32
Hi Aaron M.Hawryluk,
did you try to look recipients after you call ResolveAll().
did you find any difference or change there in compare to the value before calling the recipients.