Address
MSMQMailRecipient

The Address property specifies the e-mail address of the recipient.

Type: String
Run time: Read-write

Syntax

object1,object2.Address
 
Syntax Element Description
object1 An e-mail (MSMQMailEMail) object that defines an e-mail message.
object2 Recipient (MSMQMailRecipient) object the represents the e-mail recipient.

Settings

String representation of the e-mail recipient's address. Use one of the following formats:

"UserAlias@ServerInputQueueLabel"    Exchange Connector
"MAPIUserInputQueueLabel"            MAPI Transport Provider
"ApplicationInputQueueLabel"         MSMQ Application
 

Remarks

Typically, Address is not referenced explicitly. In most cases, it is set when adding a recipient to the recipient list.

When the e-mail is being sent to an MSMQ application, the recipient's address is the label (Label) or the application input queue.

When the e-mail is being sent to an e-mail user, the recipient's address varies depending on which MSMQ Mail service is being used.

Example

This example defines an e-mail form, adding three recipients to the e-mail's recipient list. The e-mail object is composed into a mail message and then each recipient is displayed.

To try this example using Microsoft Visual Basic (version 5.0), paste the code into the Code window of a form, enter a valid user address for each recipient, run the example, and click the form.

Dim email As New MSMQMailEMail
Dim msg As New MSMQMessage

Private Sub Form_Click()

   '*********************
   '*  Define e-mail
   '*********************

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

   'Add Recipients.
   email.Recipients.Add "Exchange_User", "UserAlias@ServerInputQueueLabel", MSMQMAIL_RECIPIENT_TO
   email.Recipients.Add "MAPI_User", "MAPIUserInputQueueLabel", MSMQMAIL_RECIPIENT_CC
   email.Recipients.Add "MSMQApplication", "ApplicationInputQueueLabel", MSMQMAIL_RECIPIENT_BCC
   
   'Set who sent the e-mail.
   email.Sender.Name = "Our name"
   email.Sender.Address = "Our queue label"

   'Set subject of mail.
   email.Subject = "Test mail"
   
   'Set name of form
   email.FormData.Name = "Test form"
   
   'Set form field list.
   email.FormData.FormFields.Add "StringField", "Test Field"
   
   'Compose message Body
   msg.Body = email.ComposeBody


   '*********************
   '* Display Recipients.
   '*********************

   Dim recipient As MSMQMailRecipient

   For Each recipient In email.Recipients
       MsgBox "Recipient: " + recipient.Name + " at " + recipient.Address
   Next recipient

End Sub
 

QuickInfo

  Windows NT: Requires version 4.0 SP3 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Import Library: Included as a resource in mqmailoa.dll.
  Unicode: Defined only as Unicode.

See Also

Add, ComposeBody, ContentType, FormData, FormFields, MSMQMailEMail, Name, Recipients, Sender, Subject