Click or drag to resize
MimeKit

IMimePartGetBestEncoding(EncodingConstraint, CancellationToken) Method

Calculate the most efficient content encoding given the specified constraint.

Namespace: MimeKit
Assembly: MimeKit (in MimeKit.dll) Version: 4.7.1
Syntax
C#
ContentEncoding GetBestEncoding(
	EncodingConstraint constraint,
	CancellationToken cancellationToken = default
)

Parameters

constraint  EncodingConstraint
The encoding constraint.
cancellationToken  CancellationToken  (Optional)
The cancellation token.

Return Value

ContentEncoding
The most efficient content encoding.
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptionconstraint is not a valid value.
ObjectDisposedException The IMimePart has been disposed.
OperationCanceledException The operation was canceled via the cancellation token.
IOException An I/O error occurred.
Remarks
If no Content is set, SevenBit will be returned.
See Also