none
Save S/MIME attachments as file ? RRS feed

  • Question

  •     

    I have several encrypted messages.and I want to save "smime.p7m" as file. but I found this attachment can't be saved as attachment of simple Email.I found all property and method of _MailItem object indicate encrypted Email is invalid .Can anyone tell me how to do ? 

    Thank you!!

    Thursday, December 6, 2012 7:40 AM

Answers

  • as soon as you access mail via OOM, it decrypts mail for you. I would suggest either using Redemption www.dimastr.com/redemption or accessing IMessage object yourself from code (first option will be much easier, but since you are using c++ already, you can also go with second one)
    Friday, December 7, 2012 8:33 AM

All replies

  • Just to be sure: you want to save smime.p7m attachment (which in reality is whole content of mail, attachments, etc.) verbatim to disk? no decryption, etc.? Show us code how are you trying to do it.
    Thursday, December 6, 2012 12:53 PM
  •        yes. I want to save smime.p7m attachment verbatim to disk whether it's decrypted or encrypted .

    I use Outlook Object model and found this interface have not access to the encrypted Email .  so I don't know what I should do?  Can you tell me whether CDO can sovle this problem?

    The following code is fragment.

    spMailItem->get_Attachments(&spAttachs);
    spAttachs->get_Count(&count);
    if (count!=0)
    {
    spAttachs->Item(index,&spAttach);

    BSTR path;
    path=SysAllocString(L"c:\\attach.txt");

                            spAttach->SaveAsFile(path);

    }

     

    Friday, December 7, 2012 6:50 AM
  • as soon as you access mail via OOM, it decrypts mail for you. I would suggest either using Redemption www.dimastr.com/redemption or accessing IMessage object yourself from code (first option will be much easier, but since you are using c++ already, you can also go with second one)
    Friday, December 7, 2012 8:33 AM