MailMessageIsEncrypted Property
Indicates if the message is encrypted.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.4 build 677 for .NET 4.5
Syntax
public bool IsEncrypted { get; }

Property Value

Type: Boolean
true if the message is encrypted; otherwise, false.
Remarks

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.

Examples
This sample downloads a message from the POP3 server and reports whether this message is encrypted.
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);
        }
    }
}
See Also