Search code examples
delphioutlook-redemption

Redemption sending fails after Windows Update with MAPI_E_NO_RECIPIENTS


  • Redemption: 5.10.0.4312
  • Delphi 2007/32
  • MS Office 365 / Outlook 2016 v1710

A Windows update downloaded yesterday ("Feature update to Windows 10, version 1709") has broken Redemption code for sending mail. The simplified code is:

OutlookApp  := GetActiveOleObject(Outlook_Application_Class);
OLNameSpace := OutlookApp.GetNameSpace(MAPI_NAMESPACE);
OLNameSpace.Logon;

myOutlookItem := OutlookApp.CreateItem(olMailItem);
myItem := CreateOLEObject(Redemption_SafeMailItem_Class);
myItem.Item := myOutlookItem;

myRecipient := myItem.Recipients.Add(toRecipient); // <---- 'test@testing.com'
myRecipient.Type := olTo;
myItem.Recipients.ResolveAll;  // <----------- myItem.Recipient count = 0

myItem.Subject := AMessage_Subject;
myItem.Body := AMessage_Body;

myItem.Send;  // <--- ERROR: Error in IMessage.SubmitMessage: MAPI_E_NO_RECIPIENTS

If I do not use Redemption it works correctly.

If I change myItem.Recipients.Add to myOutlookItem.Recipients.Add, I get MAPI_E_AMBIGUOUS_RECIP

Have also tried:

  • Restarting Windows
  • Re-registering Redemption DLL
  • Using myItem.Recipients.AddEx
  • Trying the latest Redemption version, 5.15.0.4892

Any suggestions on what to try next?

Thanks


Solution

  • Windows update is known to wipe out some registry keys responsible for MAPI marshalling. You can try to install the registry fix from https://groups.yahoo.com/neo/groups/Outlook-Redemption/conversations/topics/9600 or try to reinstall Outlook.