Click or drag to resize
MimeKit

MimeMessageEncrypt Method

Encrypt the message to the sender and all of the recipients using the specified cryptography context.

Namespace:  MimeKit
Assembly:  MimeKit (in MimeKit.dll) Version: 2.14.0
Syntax
C#
public void Encrypt(
	CryptographyContext ctx
)

Parameters

ctx
Type: MimeKit.CryptographyCryptographyContext
The cryptography context.
Exceptions
ExceptionCondition
ArgumentNullExceptionctx is null.
ArgumentException An unknown type of cryptography context was used.
InvalidOperationException

The Body has not been set.

-or-

No recipients have been specified.

CertificateNotFoundException A certificate could not be found for one or more of the recipients.
PublicKeyNotFoundException The public key could not be found for one or more of the recipients.
Remarks
If either of the Resent-Sender or Resent-From headers are set, then the message will be encrypted to all of the addresses specified in the Resent headers (Resent-Sender, Resent-From, Resent-To, Resent-Cc, and Resent-Bcc), otherwise the message will be encrypted to all of the addresses specified in the standard address headers (Sender, From, To, Cc, and Bcc).
See Also