Topic Path: Symbol Reference > Classes > TIdMessage Class > TIdMessage Properties > ConvertPreamble Property
ContentsIndexHome
PreviousUpNext
TIdMessage.ConvertPreamble Property

Indicates if a misplaced message body is converted prior to transmission.

property ConvertPreamble: Boolean;

ConvertPreamble is a Boolean property that indicates if a misplaced message body should be converted for multipart MIME-encoded messages prior to sending the message using TIdMessageClient

ConvertPreamble is an attempt by the Indy developers to save the programmer from knowing some of the more intricate rules about creating multipart MIME-encoded messages. For instance, a multipart MIME message is generally indicated by the following property values: 

 

Property 
Value 
meMIME 
'multipart/alternative', 'multipart/related', 'multipart/mixed' 

 

In this scenario, the Body in TIdMessage is not supposed to be used for text that represents a message body. One or more TIdText instances are supposed to be created that represent each of the message bodies. The reason? The TIdMessage.Body property is being populated during transmission with the MIME preamble represented by the SThisIsMultiPartMessageInMIMEFormat resource string. 

In common usage, developers were creating message parts for some representations of message bodies and continuing to use TIdMessage.Body as a message body as well. Rather than continually insisting that programmers learn the rules for constructing multipart MIME messages, the Indy library has specified the ConvertPreamble property and implemented its use during message transmission. 

When ConvertPreamble contains True (and the preceeding criteria has been met), any non-blank value in the TIdMessage.Body property is converted to a TIdText instance and stored as the initial item in the MessageParts property. The TIdText instance is given the following property values: 

 

Property 
Value 
'text/plain' 
ContentTransfer 
'7bit' 

 

If the default property values in the TIdText instance are not appropriate for your usage, create a TIdText in MessageParts with the correct values and remove the contents of TIdMessage.Body that triggers this action. 

The default value for ConvertPreamble is True, as assigned in the ClearHeader method. 

If you want to set your own preamble text rather than the default SThisIsMultiPartMessageInMIMEFormat, then put your preamble text in Body and set ConvertPreamble to False. 

ConvertPreamble is used in the TIdMessageClient.SendBody method.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.