As far as I know, there is no such support in bare .NET. You should try one of the third-party libraries. One of them is Rebex Secure Mail for .NET . The following code shows how to achieve it:
using Rebex.Mail;
using Rebex.Mime.Headers;
using Rebex.Security.Certificates;
...
Certificate signer = Certificate.LoadPfx("hugo.pfx", "password");
Certificate recipient = Certificate.LoadDer("joe.cer");
MailMessage message = new MailMessage();
message.From = "hugo@example.com";
message.To = "joe@example.com";
message.Subject = "This is a simple message";
message.BodyText = "Hello, Joe!";
message.BodyHtml = "Hello, <b>Joe</b>!";
message.Sign(signer);
message.Encrypt(recipient);
(Code taken from the S / MIME training page )
source
share