We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Signed message not visible in Web based email

I have been sending out signed emails to web-based email services like Gmail, but received email contents are not visible in email body.

Hi Acton,

Web based email cleints may not be able to display body contents of a
Signed message. This can be taken care of by detaching the certificate
before sending it to web based email clients. The detached flag in the
overloaded method of AttachSignature can be used to achieve
this. If set to true, the certificate is detached from the email and
vice versa. To see Signed Message body in Web based clients, you need
create MailMessage with detached signature.

Sample Code:

string privateCertFile = @“D:\Certificates\dr38445\dr38445.pfx”;
X509Certificate2 privateCert = new X509Certificate2(privateCertFile, “3p8a4s4s5word”);
MailMessage msg = new MailMessage("dr38445@gmail.com", "dr38445@gmail.com", “subject:Signed message only by AE”, “body:Test Body of signed message by AE”);

MailMessage signed = msg.AttachSignature(privateCert, true);

SmtpClient smtp = GetSmtpClientDr38445(); //some test account