ContentType
MSMQMailEMail

The ContentType property specifies the type of e-mail object (MSMQMailEMail).

Quick Info

Type: Long
Run time: Read-write

Syntax for E-mail Type

object.ContentType
 
Syntax Element Description
object An e-mail (MSMQMailEMail) object that defines an e-mail message.

Settings

When specifying the type of e-mail message, ContentType can have any one of the following values:

MSMQMAIL_EMAIL_TEXTMESSAGE
The e-mail message consist of a text message (see TextMessageData).
MSMQMAIL_EMAIL_FORM
The e-mail message is a form (see FormData).
MSMQMAIL_EMAIL_TNEF
The e-mail message is a TNEF message (see TnefData).
MSMQMAIL_EMAIL_DELIVERY_REPORT
The e-mail message is a delivery report (see DeliveryReportData).
MSMQMAIL_EMAIL_NON_DELIVERY_REPORT
The e-mail message is a non-delivery report (see NonDeliveryReportData).

Remarks

This property must be set when defining an e-mail object.

Example

This example prints out the form specific information of a e-mail form or the text-message information of an email text message.

To try this example using Microsoft® Visual Basic® (version 5.0), paste the code into the Code window of a form, and then run the example and click the form.

Dim email As New MSMQMailEMail
Dim msg As New MSMQMessage

Private Sub Form_Click()

   '*********************
   '*  Define form e-mail
   '*********************
   'Set e-mail type to form message.
   email.ContentType = MSMQMAIL_EMAIL_FORM

   'Add primary recipient.
   email.Recipients.Add "Exchange_User", "ExchangeUser@ServerInputQueueLabel", MSMQMAIL_RECIPIENT_TO

   'Set who sent the e-mail.
   email.Sender.Name = "Our name"
   email.Sender.Address = "Our queue label"

   'Set subject of mail.
   email.Subject = "Test form."
  
   'Set form name.
   email.FormData.Name = "Test Form"

   'Set form field list.
   email.FormData.FormFields.Add "Name", "Test Field"
  
  '************************
  '* Compose message bodies.
  '************************
  msg.Body = email.ComposeBody

  MsgBox "The e-mail form object was created."
  
End Sub
 

See Also

Add, Address, ComposeBody, FormData, MSMQMailEMail, MSMQMessage, Name, Recipients, Subject


© 1997 by Microsoft Corporation. All rights reserved.