TnefConversionOptionsAttachmentPlaceholderCallback Property

Get or set the method used to generate the text for attachment placeholders in an RTF message body.

Definition

Namespace: MimeKit.Tnef
Assembly: MimeKit.Core (in MimeKit.Core.dll) Version: 5.0.0
C#
public TnefAttachmentPlaceholderCallback? AttachmentPlaceholderCallback { get; set; }

Property Value

TnefAttachmentPlaceholderCallback
The attachment placeholder callback, or . The default is .

Remarks

Microsoft Outlook and Exchange mark the position at which each attachment is displayed in an RTF message body with a placeholder, as described by [MS-OXRTFEX] section 2.2.3.4. When the text/plain and text/html bodies are generated from the RTF body, the attachments that are images that web browsers can display are rendered as <img> elements in the text/html body. Other placeholders produce nothing unless this callback is set.

When set, the callback is invoked once for each attachment that has a placeholder, and the text that it returns (if any) is written at that attachment's placeholder in the text/plain body and, unless the attachment is rendered as an image, in the text/html body (where it is HTML-encoded). If the number of placeholders does not match the number of attachments, the text is appended to the end of the body.

The callback is not invoked when the message is converted using its MimeSkeleton, or when the text/html body is extracted from HTML that is encapsulated within the RTF body (in which case only the text/plain body uses the text).

See Also