Description
-
Adds new attachment from a string to the message
Return Type
-
A SmtpMsg
object.
Syntax
-
object.AttachText (Text, Name,
ContentType, Encoding)
The AttachText Method syntax has these parts:
| object |
An expression
evaluating to an object of type SmtpMsg. |
| Text |
Required. A String value. Text
that will be used as attachment. |
| Name |
Required. A String value. Name
of file you want to use for your attachment. |
|
ContentType |
Required. A String
value. Specifies Content-Type header value. |
| Encoding |
Required. A Variant
value. Specifies preferred
encoding type. |
Remarks
-
Unlike Attach method
which requires an existing file on your disk, AttachText method will add attachment directly from
a string.
If you want to use normal unencrypted data inside AttachText, you
need to use encUNKNOWN for
Encoding
type. Component will encrypt such
attachment using Base64 encoding before message is send.
If any other type of encryption is used for Encoding, component will
expect that data is already encrypted using encoding type that is
selected.
Name of the attachment should be specified as Name argument,
while value of content-type header should be specified as ContentType
argument.
|