The ContentType property specifies the type of e-mail object (MSMQMailEMail).
Type: | Long |
Run time: | Read-write |
object.ContentType
Syntax Element | Description |
object | An e-mail (MSMQMailEMail) object that defines an e-mail message. |
When specifying the type of e-mail message, ContentType can have any one of the following values:
This property must be set when defining an e-mail object.
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
Add, Address, ComposeBody, FormData, MSMQMailEMail, MSMQMessage, Name, Recipients, Subject