Distinct offers Network Monitor, the ONLY natural language Protocol Analyzer, ONC RPC for C++, .NET and Java, and IntelliTerm, the fastest Terminal Emulator for TN3270, TN5250 and VT420 on the market.

Distinct VIT: MIME Control: OnHeader

   Products   Downloads   Sales   Support   About us
  VIT



        
 

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



Browse FAQ

Related Products
Mail Objects

Recommended Add-On
Network Monitor,
Protocol Analyzer


Raves
"The night before I went on summer holiday we had to make some 'last minute' configuration changes to approx. 300 routers, a tedious job to do manually with telnet. We went along with MS Excel containing a list of IP-adresses to the routers, and the VIT telnet-component. One hour later the VBA-application (small is beautiful) was working, and after another hour all of our routers were updated with the new configuration. I just say a big "Thanks" to you all for a good sleep that night."
Eirik Brendholen, Ergo Integration AS

"We conducted a test session to compare the performance of similar products, and Distinct's product was better!" [more]
Dr. Shyam Sunder, Carnegie Mellon University

"Together with Distinct, we were able to offer our users an ideal soution to enabling them to connect to Yahoo! Pager, and to do so both quickly and reliably." [more]
Brian Park,
Producer of Yahoo! Pager, Yahoo! Inc.


  9/8/2008   Legal notices | PRIVACY Policy | Networking News |