The Data property specifies the data of a TNEF e-mail.
Type: | Variant (variant type is an array of bytes) |
Run time: | Read-write |
object1.object2.Data
Syntax Element | Description |
object1 | E-mail (MSMQMailEMail) object that defines the e-mail message. |
object2 | TNEF data (MSMQMailTnefData) object that represents the text message. |
A variant which contains the TNEF data of the e-mail. The data in the variant should be an array of bytes representing the TNEF data.
TNEF is a MAPI internal format that encapsulates the MAPI properties, and is used by the MSMQ Mail services (the MSMQ Exchnage Connector and the MSMQ MAPI Transport) to send mail to recipients who are defined as rich-text recipients. These recipients have selected the check box labeled "Send to this recipient in Microsoft Exchange rich text format" in their Exchange/MAPI address.
This example defines an e-mail object as a TNEF message, setting the TNEF message body to a predefined variant value that should be filled by MAPI or taken from another TNEF message. The email object is then used to compose the body of a mail message, and a message box displays the size of the TNEF data (the data itself is binary and is not supposed to be readable).
To try this example using Microsoft Visual Basic (version 5.0), paste the code into the Code window of a form, then run the example and click the form.
Dim email As New MSMQMailEMail Dim msg As New MSMQMessage Private Sub Form_Click() '*********************** '* Define e-mail object '*********************** 'Set e-mail type to TNEF message email.ContentType = MSMQMAIL_EMAIL_TNEF 'Add Recipients email.Recipients.Add "Connector Recipient Name", "ExchangeUser@ServerInputQueueLabel", MSMQMAIL_RECIPIENT_TO email.Recipients.Add "MAPI Recipient Name", "MAPIUserInputQueueLabel", MSMQMAIL_RECIPIENT_CC 'Set the TNEF information of the e-mail. email.TnefData.Data = tnefdata '********************** '* Compose message Body '********************** msg.Body = email.ComposeBody '**************************** '* Display size of TNEF data. '**************************** MsgBox "The size of the TNEF data is:" + (UBound(email.TnefData.Data) - LBound(email.TnefData.Data) + 1) End Sub
Add, Address, Body, ComposeBody, ContentType, MSMQMailEMail, MSMQMessage, Name, Recipients, Sender, Subject, TextMessageData