Back to product page

EmbedText Method


Adds new embedded image to the message, from the string.

Type

A String value. CID that should be referenced from HTML part, usually in <IMG SRC=...> tag.

Syntax

  • Basic
object.EmbedText (Text, ContentType, Encoding)
The EmbedText(object,Text,ContentType,Encoding) syntax has these parts:
objectAn expression evaluating to an object of type SmtpMsg
TextRequired. A String value. Image contents that should be Embedded into the message.
ContentTypeOptional. A Variant value. Specifies Content-Type header value.
EncodingOptional. A Variant value. Specifies preferred encoding type (base64 is default).

Remarks

EmbedText method does the same as Embed method. The only difference is that EmbedText expects image contents as a String representation.

Text parameter expects either encoded, or plaintext value. ContentType parameter represents type of the image being embedded. This value will be assigned to Content-Type header related to message part containing the embedded image.

Encoding parameter represents value of 'Content-Transfer-Encoding' header that will be automatically set for the image. Depending on this setting, component will expect provided Text parameter to already hold contents in specified encoding. If Encoding parameter is set to encUNKNOWN, the component will by try encoding into Base64 format.

Make sure you set ContentType argument properly, otherwise image will not be displayed correctly. For GIF images, you should set image/gif, and for JPEG images you should set image/jpeg.

Platforms

Windows