|
Summary
Send header information. This event has been deprecated. Header information is now set
in the OnSetHeader event.
Description
The OnHeader event will be fired during the create message to obtain the header
information for the attachments. The ContentId, Encoding, ContentType and Subtype
properties must be set appropriately. The Charset property may be set to a valid character
set. Please check the reference pages for additional information.
For non-MIME messages, set Status to 0 to indicate the end of the header. For
MIME messages, set the Status parameter to END_OF_LEVEL to indicate end of header.
Otherwise, set Status to 1.
If there is no header, set Status to NO_HEADER. This indicates that there is no
header and the body will not be encoded.
In some environments such as Visual J++, the new value assigned to the Status
parameter can not be successfully retrieved by the control. In these cases set UseProperty
to True, and assign the status to the AttachmentStatus property instead of the Status
parameter. The UseProperty property must be set to True before attempting to create a
message. In this case treat the AttachmentStatus property exactly as you would the Status
parameter.
For a partial message, the first part must include the header of the encapsulated
message. The ContentType and Subtype properties must be specified for the encapsulated
message (such as "image", "audio", "video", etc.). All other
parts will not have a header
To abort the create message, set the Action property to ACTION_ABORT (or call the Abort
method) during this event. The action in progress will be canceled and no further such
events will occur.
Example
Sub Mime_OnHeader (Status As Integer)
' no attachments
If (HeaderIndex = 0) Then
Status = 0
Exit Sub
End If
' increment Indx
Indx = Indx + 1
' finished all attachments
If (Indx >= HeaderIndex) Then
If (MsgType = 1 Or MsgType = 0) Then
Status = 0 ' plain message
Else
Status = END_OF_LEVEL ' mime message
End If
Exit Sub
End If
' fill fields
If MsgType = 1 Then ' plain message
'check encoding
If HeaderInfo(Indx).Encoding = TYPE_TEXT Then
Mime.Encoding = "text"
Else
Mime.Encoding = "uuencode"
End If
ElseIf MsgType = 2 Then ' mime message
'check encoding
If HeaderInfo(Indx).Encoding = BASE64_ENCODED Then
Mime.Encoding = "base64"
ElseIf HeaderInfo(Indx).Encoding = QUOTED_ENCODED Then
Mime.Encoding = "quoted-printable"
Else
Mime.Encoding = "text"
End If
' check mime filetype
If HeaderInfo(Indx).Type = TYPE_AUDIO Then
Mime.ContentType = "audio"
Mime.Subtype = "basic"
ElseIf HeaderInfo(Indx).Type = TYPE_VIDEO Then
Mime.ContentType = "video"
Mime.Subtype = "basic"
ElseIf HeaderInfo(Indx).Type = TYPE_IMAGE Then
Mime.ContentType = "image"
Mime.Subtype = "gif"
ElseIf HeaderInfo(Indx).Type = TYPE_APPLICATION Then
Mime.ContentType = "application"
Mime.Subtype = "octet-stream"
Else
Mime.ContentType = "text"
Mime.Subtype = "plain"
End If
End If
' set filename
Mime.FileName = HeaderInfo(Indx).Filename
AttachDone = False
Status = 1
End Sub
|