Click or drag to resize
MimeKit

ParameterEncodingMethod Property

Get or set the parameter encoding method to use.

Namespace: MimeKit
Assembly: MimeKit (in MimeKit.dll) Version: 4.3.0
Syntax
C#
public ParameterEncodingMethod EncodingMethod { get; set; }

Property Value

ParameterEncodingMethod
The encoding method.
Exceptions
ExceptionCondition
ArgumentOutOfRangeExceptionvalue is not a valid value.
Remarks

Gets or sets the parameter encoding method to use.

The MIME specifications specify that the proper method for encoding Content-Type and Content-Disposition parameter values is the method described in rfc2231. However, it is common for some older email clients to improperly encode using the method described in rfc2047 instead.

If set to Default, the encoding method used will default to the value set on the FormatOptions.

Example
C#
// Some versions of Outlook expect the rfc2047 style of encoding of parameter values.
foreach (var parameter in part.ContentDisposition.Parameters)
    parameter.EncodingMehod = ParameerEncodngMethod.Rfc2047;
See Also