none
how to decrypt mail in outlook programmatically (C#) ? RRS feed

  • Question

  • Hi,

    I have a requirement where the encrypt option is selected by default in outlook.. i need an addin which decrypts mail before sending it.. I m developing a C# outlook addin. Any  code snippets would be helpful.

    Thanks.

    Friday, July 27, 2012 6:03 AM

Answers

  • yes, as i already wrote, if user chooses to decrypt mail, cancel sending and execute ThisOutlookSession.ActiveInspector.CommandBars.ExecuteMso ("EncryptMessage").
    Monday, July 30, 2012 7:25 AM

All replies

  • by default outlook gives you decrypted mail for access using OOM. So simplest option would be to copy mail (but not using Copy method because it would most probably give you also encrypted mail) property by property, cancel sending original mail and send yours. Or you could try to 'deselect' encrypt mail option in inspector.
    Friday, July 27, 2012 7:55 AM
  • Thanks for the reply..

    Is there any code snippet which does the same?

    On deselecting the encrypt mail option using inspector, is it only for the current mail sent? or will the settings be saved for the further mails also?

    Thanks.

    Friday, July 27, 2012 8:00 AM
  • sample in VBA, convert it to your language

    ThisOutlookSession.ActiveInspector.CommandBars.ExecuteMso ("EncryptMessage")

    and it will do it only for current mail. If you want to do it for all mails, you ave to instruct user to change global settings in outlook, this cannot be done from OOM.

    Friday, July 27, 2012 11:13 AM
  • Thanks for the reply.

    Is there a command for decrypt? like -

    ThisOutlookSession.ActiveInspector.CommandBars.ExecuteMso ("DecryptMessage")  ??

    Thanks,

    Monday, July 30, 2012 2:54 AM
  • In outlook the "Encrypt content" settings is selected by default in my case. When the user sends a mail, the addin should popup a message box asking whether the mail has to sent encypted. If the user selects "No", the mail should be sent without encrypting.

    So is there a command to send the mail without encrpting when the settings "Encrypt content" has been set to true?

    Thanks.

    Monday, July 30, 2012 5:21 AM
  • yes, as i already wrote, if user chooses to decrypt mail, cancel sending and execute ThisOutlookSession.ActiveInspector.CommandBars.ExecuteMso ("EncryptMessage").
    Monday, July 30, 2012 7:25 AM