none
Redemption 5.2 + MS Exchange Server 2010 64bit RRS feed

  • Question

  • Hi, A user is getting following errors while sending emails from a application developed by VFP SP 2 (32bit) and email sends without attachments with following errors.

    OLE IDispatch exception code 0 from Redemption.Attachments: Error in IAttach.OpenProperty(MAPITags.PR_ATTACH_DATA_BIN: MAPI_E_INTERFACE_NOT_SUPPORTED..

    Error in IAttach.OpenProperty(MAPITags.PR_ATTACH_DATA_BIN: MAPI_E_INTERFACE_NOT_SUPPORTED

    Environment:

    MS Outlook 2007 32bit

    MS Exchange Server 2010 64bit

    All are working fine when send emails directly through MS Outlook (i.e. without using Redemption.SafeMailItem).

    Anybody has a clue of what is cauing above errors?

    Thanks in advance!


    Cheers!

    Thursday, April 5, 2012 6:36 AM

All replies

  • Chances are you are trying to open an embedded message attachment as a regular by-value attachment.

    What is your code?

    Do you check the Attachment.Type property?


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.2 is now available!

    Thursday, April 5, 2012 6:47 AM
  • Hi Dmitry, I don't use Attachment.Type property also not trying to open any attachments during the process.

    Can this be due to any corrupted attachments?

    • Edited by eCasper Thursday, April 5, 2012 7:32 AM
    Thursday, April 5, 2012 7:05 AM
  • What is your code? Which Redemption method raises the error?


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.2 is now available!

    Sunday, April 8, 2012 3:39 PM
  • Hi eCasper,

    Any update?

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, April 10, 2012 6:28 AM
    Moderator
  • Hi, Still I'm strugling with this. I think Redemption.Attachments raises the error.

    Following is my code.

    LOCAL loOutlookSession, loMailItem, loOutBox, loRDOSession, loOutBoxMailItem
    loOutlookSession = CREATEOBJECT("Outlook.Application")
    loOutBox 		= loOutlooksession.GetNameSpace("MAPI").GetDefaultFolder(inOutBox)
    loMailItem 		= CREATEOBJECT("Redemption.SafeMailItem")
    IF VARTYPE(loMailItem) = "O"
    	IF TerminalService && if running under terminal service.
    		loRDOSession = CreateObject("Redemption.RDOSession")
    		loRDOSession.Logon()
    		loOutBoxRdo = loRDOSession.GetDefaultFolder(inOutBox)
    		loMailItem = .F.
    		loMailItem = loOutBoxRdo.Items.Add(inMailItem)		
    	ELSE
    		loMailItem.Item = loOutBox.Items.Add(inMailItem)	
    	ENDIF 
    ELSE 
    	loMailItem = loOutBox.Items.Add(inMailItem)	
    ENDIF 
    ** Assign recipients here...
    ** Assign att. here...
    loMailItem.Attachments.Add("D:\My Docs\test.pdf", 1)
    ** Other properties that are initialized.
    ** .ReadReceiptRequested, .Importance, .ReplyRecipients.
    IF lnCurrentMsOutLookVersion => inMsOutLook2010Version OR ;
    		(lnCurrentMsOutLookVersion => inMsOutLook2002Version AND lnCurrentMsOutLookVersion < inMsOutLook2003Version)
    	loMailItem.Save()
    ENDIF	
    ** If the name of the folder where the mail is composed is not Outbox, move it into Outbox
    IF !UPPER(loOutBox.Name) == UPPER(loMailItem.Parent.Name)
    	** Check if the Move() exists before its used
    	AMEMBERS(laMailItemMembers, IIF(TYPE("loMailItem.Item")="O",loMailItem.Item,loMailItem), 3)
    	lnSearchedMethodRow = ASCAN(laMailItemMembers, "Move", 1, -1, 1, 15)
    	IF lnSearchedMethodRow > 0
    		loOutBoxMailItem = loMailItem.Move(loOutBox)
    		IF VARTYPE(loOutBoxMailItem) = "O"
    			RELEASE loMailItem
    			loMailItem = CREATEOBJECT("Redemption.SafeMailItem")
    			loMailItem.Item = loOutBoxMailItem
    		ELSE
    			** If the mail could not be moved send it from the Drafts folder
    		ENDIF
    	ELSE
    		** If the Move() does not exists, send the mail from the Drafts folder
    	ENDIF
    ENDIF
    loMailItem.Send()

    Just give a proper update on this. Earlier the redemption version that we used is 4.5.0.812 and it produced corrupted attachments in the email. Now after upgrading into 5.2. above problem appears and no more corrupted attachments. Emails send without attachments with the above error.


    Cheers!


    • Edited by eCasper Thursday, May 10, 2012 7:08 AM
    Thursday, May 10, 2012 6:39 AM
  • What is the exact error?

    Also, why do yu use either SafeMailItem or teh RDO family of objects? Or not use just one?

    There is no reason to call RDOSesion.Logon if you already have a pointer to the Outlook.Application object - simply set the RDOSession.MAPIOBJECT property to Namespace.MAPIOBJECT from Outlook.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.3 is now available!

    Thursday, May 10, 2012 6:58 AM
  • Hi Dmitry

    following is the Error:

    OLE IDispatch exception code 0 from Redemption.Attachments: Error in IAttach.OpenProperty(MAPITags.PR_ATTACH_DATA_BIN: MAPI_E_INTERFACE_NOT_SUPPORTED..

    Error in IAttach.OpenProperty(MAPITags.PR_ATTACH_DATA_BIN: MAPI_E_INTERFACE_NOT_SUPPORTED

    We have been using SafeMailItem since long time and we would like to stick to the same functionality. RDO is something we recently got used to and it’s only when SafeMailItem is failed.

    Do you think "RDOSesion.Logon" causing the problem here. I'm not sure whether RDO even in use in this particulare case.


    Cheers!

    Thursday, May 10, 2012 7:19 AM
  • That error is an indication that you are treating embedded mesage or an OLE attachment like a regular by-value attachment.

    Which line of your code raises the error?


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.3 is now available!

    Thursday, May 10, 2012 7:29 AM
  • I think error raises at loMailItem.Send() line.

    Cheers!

    Thursday, May 10, 2012 9:12 AM
  • SafeMailItem.Send does not call IAttach.OpenProperty().

    Send me an e-mail to dmtry at dimastr dot com and I will send you a debug version of Redemption.dll.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.3 is now available!

    Thursday, May 10, 2012 3:04 PM
  • Hi Dmitry, I sent you the Redemption.log created.


    Cheers!

    Friday, May 25, 2012 6:08 AM
  • Hi All,

    According to the Redemption. log file, error produces at following line of code.

    loMailItem.Attachments.Add("D:\My Docs\test.pdf", 1)

    As a workground, Dimitry suggested following fix and it worked but I wonder under what circumstances Redemption produce this error  and when this will be fixed in the Redemption.dll....?

    loMailItem.Item.Attachments.Add("D:\My Docs\test.pdf", 1)



    Cheers!


    • Edited by eCasper Friday, July 6, 2012 6:01 AM
    Friday, July 6, 2012 6:00 AM
  • the error is raised when Redemption tries to open/create PR_ATTACH_DATA_BIN property. I would avoid using the Safe*Item objects for this and use the RDO objects since they do not depend on OOM at all and work with the real MAPI objects instead of a wrapper returned by MailItem.MAPIOBJECT in OOM.


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.3 is now available!

    Saturday, July 7, 2012 9:03 PM