function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
RyanAtTGHRyanAtTGH 

How to restrict access to Email Messages (and attachments) conditionally, depending on sender or recipient

Some emails that are related to the Case record have sensitivty information. Is there a way to restrict visibility to those related Email Messages and associated attachments, if the email sender or recipient is a specific email address?
VinayVinay (Salesforce Developers) 
Hi Ryan,

I don't think you can restrict email access based on sender and recipient and this would be out of box functionality.

Check if there is any way using EmailMessage, but I don't think this would be possible.

https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_emailmessage.htm

Please mark as Best Answer if above information was helpful.

Thanks,
RyanAtTGHRyanAtTGH
Right, that is what my reseach shows. Perhaps a programmatic way to do this? 
VinayVinay (Salesforce Developers) 
I haven't seen any examples or working scenerio earlier,  even if you want to implement that would require complex code handling and as per my understanding this wont be possible in progrramatic way as well.

Thanks,