ParserOptionsRegisterMimeType Method

Register a MimeEntity subclass for the specified mime-type.

Definition

Namespace: MimeKit
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
C#
public void RegisterMimeType(
	string mimeType,
	Type type
)

Parameters

mimeType  String
The MIME type.
type  Type
A custom subclass of MimeEntity.

Remarks

Your custom MimeEntity class should not subclass MimeEntity directly, but rather it should subclass Multipart, MimePart, MessagePart, or one of their derivatives.

Exceptions

ArgumentNullException

mimeType is .

-or-

type is .

ArgumentException

type is not a subclass of Multipart, MimePart, or MessagePart.

-or-

type does not have a constructor that takes only a MimeEntityConstructorArgs argument.

See Also