wodSmtp ActiveX Control - Embed Method
      
 

Description

Reads image contents from String object and adds it as a new embedded image to the message.


Return Type

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


Syntax

object.EmbedText (Text, ContentType, Encoding)



The EmbedText Method syntax has these parts:

Part Description
object An expression evaluating to an object of type SmtpMsg.
Text Required. A String value. Image contents that should be Embedded into the message.
ContentType Optional. A Variant value. Specifies Content-Type header value.
Encoding Optional. 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.