Encodes the body of the message to the specified encoding mechanism.
Syntax:
Parameters:
Returns:
Returns 1 if the operation is successful; otherwise returns 0 if the operation fails.
Remarks:
This method encodes only the body of the message. It does not encode body parts.
After successfully encoding the body, the header "Content-Transfer-Encoding" is added if it does not already exist. The value of this header depends on the mechanism used and are currently as follows:
EncodeType_Base64 "base64" EncodeType_Ascii_Baudot "baudot" EncodeType_EDA_Filter "eda-filter" EncodeType_EDC_Filter "edc-filter" EncodeType_Hexadecimal "hexadecimal" EncodeType_QuotedPrintable "quoted-printable" EncodeType_Radix64 "radix64" EncodeType_UUEncode "uuencode" Example diagram,
Example:
Dim oEdiDoc As Fredi.ediDocument
Dim oMailDocument As Fredi.mailDocument
Dim oMessage As Fredi.mailMessage
Dim sMsg As String
' Create instance of Framework EDI.
Set oEdiDoc = New Fredi.ediDocument
' Get internet mail document object
Set oMailDocument = oEdiDoc.GetMailDocument
' Load the mail document
oMailDocument.Load App.Path & "\SampleMail.TXT"
' Get the message.
Set oMessage = oMailDocument.GetMessage
' Encode body of message to base64.
oMessage.PrepareTransferEncoding EncodeType_Base64
MsgBox "Encoded Message:" & vbCrLf & vbCrLf & oMessage.GetMsgString