MailMessageIsEncrypted Property |
Namespace: MailBee.Mime
Messages can also be signed with a digital signature. To check if a message is signed or not, use IsSigned property. Note that you may also need to check IsSigned property of the decrypted message because the original message will have only IsEncrypted set but not IsSigned in case if the signature is within the encrypted data (thus, it's required to decrypt the message first in order to tell if it has a digital signature).
To operate with IsEncrypted or IsSigned messages, use Smime object.
using System; using MailBee; using MailBee.Pop3Mail; using MailBee.Mime; class Sample { static void Main(string[] args) { // Download the first mail message from the specified POP3 account. MailMessage msg = Pop3.QuickDownloadMessage("pop3.mail.com", "kathy1981", "password", 1); // Display the subject of the message if it's not encrypted. if (msg.IsEncrypted) { Console.WriteLine("The subject can not be displayed because the message is encrypted."); } else { Console.WriteLine("The message has the following subject:\r\n" + msg.Subject); } } }