TnefWriter Constructor

Initialize a new instance of the TnefWriter class.

Definition

Namespace: MimeKit.Tnef
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
C#
public TnefWriter(
	Stream stream,
	int codepage = 1252,
	ushort legacyKey = 0,
	bool leaveOpen = false
)

Parameters

stream  Stream
The output stream.
codepage  Int32  (Optional)
The codepage used to encode 8-bit strings.
legacyKey  UInt16  (Optional)
The legacy key to write in the stream header.
leaveOpen  Boolean  (Optional)
to leave the stream open after the TnefWriter is disposed; otherwise, .

Remarks

Creates a new TnefWriter that writes a TNEF stream to the specified stream.

The codepage is written as the OemCodepage attribute and is used to encode the 8-bit strings of attributes and of String8 properties. [MS-OXTNEF] requires a codepage in which no character contains a zero byte, so the UTF-16 and UTF-32 codepages are not allowed.

Exceptions

ArgumentNullException stream is .
ArgumentException stream is not writable.
ArgumentOutOfRangeException codepage is not a supported codepage, or is a codepage that encodes characters using zero bytes.

See Also