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

   Products   Downloads   Sales   Support   About us
  VIT
 



        
 

Summary

Sets the address field for a message.

Description

Before a message can be created the To, From, Cc, Bcc and Subject fields need to be set. Each of these fields can be encoded differently. This event allows the appliation to specify the value and the encoding type of each field. This event must be used once for each of the To and From fields. The Cc, Bcc and Subject fields are optional.

The Field parameter must contain "To", "From", "Cc", "Bcc" or "Subject". The Value field should contain the value of the respective header fields, the Charset field may specify the character set of the respective fields, and this field will be ignored if the Value field 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 call this method multiple times with the same field but the different values and corresponding encoding for that value.

If the Field it set to "To" then the Value parameter must be set to the mailing address (mail message) or the news group names (news article) of the recipients. If the Field parameter is set to "From" then the Value parameter must be set to the mailing address of the sender.

In some environments, such as Visual J++, the new value assigned to the Field, Value, Charset and Encoding parameters can not be successfully retrieved by the control. In these cases set UseProperty to True, and assign the parameter values to the AddrField, FieldValue, FieldCharset and FieldEncoding respectively. In this case the UseProperty property must be set to True before attempting to create a message, and treat the properties exactly as you would the respecitive parameters.

The actual internet address in the "To" can not be encoded, otherwise the message will be undeliverable. Other parts of the "To" field may be encoded, see the example below.

Example

Sub Mime_OnSetAddrField (Field As String, Value As String, Charset As String, Encoding As Integer)

If (bTo) Then
Field = "To"

Value = "santa@northpole.com"

Charset = ""

Encoding = ADDR_NO_ENCODING 'Can not encode email address

bTo = False

Else if (bTo2) Then

Field = "To"

Value = "<santa claus>"

Charset = "us-ascii"

Encoding = ADDR_BASE64_ENCODED

bTo2 = False

Else if (bFrom) Then

Field = "From"

Value = "elf@warehouse.com"

Charset = ""

Encoding = ADDR_NO_ENCODING

bFrom = False
Else

Field = ""

End If

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.


  10/14/2008   Legal notices | PRIVACY Policy | Networking News |