Encrypted Email and the Outlook VBO
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
15-02-22 08:23 PM
I've looked into this a bit based on information I've found on the internet. Creating an encrypted email in Outlook is pretty easy when you do it manually via the UI (assuming your Outlook client or Exchange server are properly configured). Microsoft provides a handy little button titled Encryption on the Options tab.
Unfortunately, doing this programmatically via interop with Outlook is bit more of a pain. 🤦♂️ Below is some code you can add to the Code stage in the Send Email action of the MS Outlook Email VBO that should allow you to encrypt and/or sign emails (assuming you have an appropriate certificate installed and configured):
Const PR_SECURITY_FLAGS As String = "http://schemas.microsoft.com/mapi/proptag/0x6E010003"
' Check flags for Encryption and Signing.
If (Encrypt_Message) And (Sign_Message) Then
mail.PropertyAccessor.SetProperty(PR_SECURITY_FLAGS, &H3)
ElseIf (Encrypt_Message) Then
mail.PropertyAccessor.SetProperty(PR_SECURITY_FLAGS, &H1)
ElseIf (Sign_Message) Then
mail.PropertyAccessor.SetProperty(PR_SECURITY_FLAGS, &H2)
End If
If you choose to add this code to your VBO, I would recommend that you create a backup copy of the VBO to make it easier to rollback should you encounter any issue.
You can add the code anywhere in the Code stage titled Send Item of the Send Email action so long as it's after the line where the variable mail is defined and initialized:
And before the two lines at the end of the Code stage where the mail item is saved and actually sent:
There are a few things to be aware of though:
- There are other examples on the internet that show this in a slightly cleaner fashion. In those cases they are performing a bitwise OR of any existing value of the PR_SECURITY_FLAGS property and the new value. That's all well and good, but my personal testing in v6.10.4 shows that when you try to pass any sort of VB.NET variable into the SetProperty call results in a Type Mismatch exception. That's why I have 3 separate lines that basically do the same thing just with a different hardcoded value at the end. I tried using variables of type Long, Integer, UInteger, ULng, Int16, Int32, Object, and String. None of them worked. 🤷♂️
- The code above expects that you'll define two input variables on the Send Email action called Encrypt Message and Sign Message, and those will be passed into the Code stage. Those variables are of type Flag.
- VERY IMPORTANT: If you make this change and you call the action on a machine who's Outlook installation has NOT been previously configured to support sending emails with encryption and signing, a pop-up window, from Outlook, will block the BP process from moving ahead. The pop-up is basically a message stating that the Outlook client has not been configured with a proper Digital ID certificate that can be used for encryption and/or signing. At that point all you can do is click the OK button on the dialog to dismiss it. When you do that, you'll receive an exception in the Code stage stating that the action was aborted.
UPDATES
20220218 - There is another option for supporting encryption in emails that we're investigating. It involves the use of Sensitivity Labels and Azure Information Protection. This only apples to users of Microsoft 365 though. Currently, the Microsoft VBOs (Excel, Word, and Outlook) do not support Sensitivity Labels, but it is a feature we're looking at adding. With Sensitivity Labels, a specific label can be applied to files/email, either automatically or manually, that results in the file/email being encrypted. You can track the progress of this work, as well as vote for it, through the DX Ideas Portal.
#Outlook #EncryptedEmail
Cheers,
------------------------------
Eric Wilson
Director, Integrations and Enablement
Blue Prism Digital Exchange
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
16-02-22 06:54 AM
Many thanks for summarize all this functionality. Really helpfull!!
Bye 🙂
------------------------------
Pablo Sarabia
Architect
Altamira Assets Management
Madrid
634726270
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
16-02-22 09:05 AM
------------------------------
----------------------------------
Regards,
Devneet Mohanty
Intelligent Process Automation Consultant | Sr. Consultant - Automation Developer,
Wonderbotz India Pvt. Ltd.
Blue Prism Community MVP | Blue Prism 7x Certified Professional
Website: https://devneet.github.io/
Email: devneetmohanty07@gmail.com
----------------------------------
------------------------------
Hope this helps you out and if so, please mark the current thread as the 'Answer', so others can refer to the same for reference in future.
Regards,
Devneet Mohanty,
SS&C Blueprism Community MVP 2024,
Automation Architect,
Wonderbotz India Pvt. Ltd.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
16-02-22 01:01 PM
------------------------------
Neeraj Kumar
Technical Architect
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
16-02-22 01:17 PM
------------------------------
Saurabh Goswami
RPA Architect
Ericsson
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
16-02-22 04:19 PM
------------------------------
Shikhar Mishra
RPA Lead
Infosys Pvt Ltd
Pune,India
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
17-02-22 11:39 AM
------------------------------
Ravi Kumar
Sr Automation Designer
Ericsson
Asia/Kolkata
------------------------------
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
30-05-22 02:40 PM
------------------------------
Nilesh Jadhav
Senior RPA Specialist
ADP
India
------------------------------
Consultant
ADP,India
