Subject
MSMQMailEMail

The Subject property specifies the subject of the e-mail.

Quick Info

Type: String
Run time: Read-write

Syntax

object.Subject
 
Syntax Element Description
object E-mail (MSMQMailEMail) object that represents the e-mail message.

Settings

String representation of the e-mail message's subject.

Remarks

Subject can be set to any valid string. There are no restrictions on this property.

Example

This example defines an text-message e-mail, setting its subject to "Test mail." The email object is then used to compose the body of a mail message, and a message box displays the e-mail's subject.

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 text message
   email.ContentType = MSMQMAIL_EMAIL_TEXTMESSAGE
   
   'Add Recipients
   email.Recipients.Add "Connector Recipient Name", "ExchangeUser@ServerInputQueueLabel", MSMQMAIL_RECIPIENT_TO
   email.Recipients.Add "MAPI Recipient Name", "MAPIUserInputQueueLabel", MSMQMAIL_RECIPIENT_CC

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

   'Set the subject of the e-mail.
   email.Subject = "Test mail."

   'Set the Body of the e-mail.
   email.TextMessageData.Text = "This is the Body of the message."
   
   '**********************
   '* Compose message Body
   '**********************
   msg.Body = email.ComposeBody

   '******************
   '* Display subject.
   '******************
   MsgBox "Subject of e-mail is:" + email.Subject

End Sub 
 

See Also

Add, Address, Body, ComposeBody, ContentType, MSMQMailEMail, MSMQMessage, Name, Recipients, Sender, Text, TextMessageData


© 1997 by Microsoft Corporation. All rights reserved.