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: OnRecvBodyB

   Products   Downloads   Sales   Support   About us
  VIT



        
 

Summary

Receive the contents or filename of the extracted message body and any attachments as binary.

Description

The OnRecvBodyB event occurs, only if the UseVariant property is set to True, in response to calling the ExtractMessageEnd method. If the UseVariant property is False then the OnRecvBody event will occur instead.

This event will occur during the extract message process to deliver the contents or filename of the message. It will also occur to deliver the file content or filename of any attachments the message may have.

The MIME ActiveX control will first extract the message header and body. The Mime ActiveX control fire the OnRecvHeader event to set the message properties, and deliver the entire message header. The body will be saved to the Destination directory (set in the call to the ExtractMessageStart) and the OnRecvBodyB event will be fired. In the OnRecvBodyB event the application should call the RecvBodyB method to get the name of the extracted file. If the Destination was set to NULL the MIME ActiveX control will fire the OnRecvBodyB event to deliver, the content of the body can then be retrieved by calling the RecvBodyB method.

The OnRecvBodyB event will be fired one or more times, usually after each OnRecvHeader event, to notify the application that is should call RecvBodyB to retrieve the contents or filename of the message body. The application will be notified of any extracted attachments in the same way.

The Bytes parameter will contain the length of the data to be retrieved, and the IsFile parameter specifies whether the data to be received is the filename or the contents of the file. If IsFile is 0 then the actual content of the message or attachment will be retrieved by calling the RecvBodyB method; otherwise if IsFile is 1 the name of the file that contains the message or attachment will be retrieved by the RecvBodyB method.

To abort the extract 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.

Technical Note

If the message to be extracted is of type multipart or "message/external-body" the sequence of the OnRecvHeader and OnRecvBodyB events may differ. In case of multipart messages a OnRecvHeader event can be followed by another OnRecvHeader event instead of a OnRecvBodyB event. After MIME ActiveX control fires the OnRecvHeader event with the initial header , the sequence will be OnRecvHeader event followed by an OnRecvBodyB event unless there is a part with no body or if there is a nested multipart in which case an OnRecvHeader event may be followed by another OnRecvHeader event. The first body part is usually treated as the message body. The extraction of the rest of the body parts will follow same sequence. The MIME ActiveX control will automatically decode any encoded body part.

Similarly if the message is of type message/external-body then the initial OnRecvHeader event will be followed by an OnRecvHeader event instead of an OnRecvBodyB event.

Note that the general sequence of upcalls will be OnRecvHeader event followed by an OnRecvBodyB event unless there is a part with no header or an empty body, in those special cases a OnRecvHeader event may be followed by another OnRecvHeader event or a OnRecvBodyB event may be followed by another OnRecvBodyB event. It is the application's responsibility to keep track of, and decide how to treat the data received in each OnRecvBodyB event. The application can so this by checking the ContentType and Subtype properties in each OnRecvHeader event.

If the message is a non-MIME message then the attachments will be extracted and the MIME ActiveX control will fire the OnRecvHeader event followed by the OnRecvBodyB event. Note that for non-MIME messages only the Encoding and the Filename properties will be set by the OnRecvHeader event.

Example

' HeaderInfo is a structure for the attachment name, encoding used and the content type
' see the MIME sample for the definition

Sub Mime_OnRecvBodyB (Bytes As Long, IsFile As Integer)
Result = RecvBodyB (Buffer, BufferLength) ' message body
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.


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