|
Summary
Obtain header field information
Description
The OnEncodeField will be fired when the EncodeHdrField method is called to get the
data to be encoded.
In the OnEncodeField event the application should set the Value parameter should
be set to the value of the header fields, the Charset parameter may be set to the
character set of the respective fields, this parameter will be ignored if the Value
doesn't need to be encoded. If the Value field needs to be encoded then the Encoding
parameter should contain either ADDR_BASE64_ENCODED or ADDR_QUOTED_ENCODED, if
encoding is not necessary the Encoding parameter should contain ADDR_NO_ENCODING.
If the application wants to use more than one type of encoding for a field then it may set
these parameters in multiple OnEncodeField events with different values and corresponding
encoding for that value each time.
The IMAP ActiveX control will fire this event, to get data to encode, until the Value
parameter is set to an empty string and the Length parameter is set to 0.
In some environments such as Visual J++, the new value assigned to the Value,
Length, Charset and Encoding parameters can not be successfully retrieved by
the control. In these cases set UseProperty to True, and assign the value to the
FieldValue property instead of the Value parameter, similarly assign the charset to
the FieldCharset property, the encoding to the FieldEncoding parameter and the length
parameter will be ignored. The UseProperty property must be set to True before attempting
to create a message.
Example
Private Sub MIME_OnEncodeField(Value As String, Length As Integer, Charset As Integer,
Encoding As Integer)
If (initial)
Value = "This file contains:"
Length = Len (Value)
Charset = "us-ascii"
Encoding = ADDR_NO_ENCODING
initial = False
Else
Value = "lots of confidential information."
Length = Len (Value)
Charset = "us-ascii"
Encoding = ADDR_BASE64_ENCODING
Done = True
EndIf
If (Done) Then
' All data given
Value = ""
Length = 0
End If
End Sub
|