The DeliveredRecipients property specifies the recipients that received a previously sent e-mail.
Type: | MSMQMailRecipientList |
Run time: | Read-write |
object1.object2.DeliveredRecipients
Syntax Element | Description |
---|---|
Object1 | E-mail (MSMQMailEMail) object that defines the delivery report. |
Object2 | Delivery report data (MSMQMailDeliveryReportData) object that represents the delivery report information. |
MSMQMailRecipientList object.
Each recipient in the delivered recipient list is represented by an MSMQMailRecipient object. Each recipient object includes the name and address of the recipient, the input queue of the recipient, how the message was sent to recipient, and when the message was delivered.
The DeliveryTime property of the MSMQMailRecipient object specifies when the original e-mail was delivered to the recipient.
This example defines a delivery report, adding two delivered recipients to the delivered recipient list of the report. The e-mail object is composed into a mail message, and each delivered 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 delivery report.
email.ContentType = MSMQMAIL_EMAIL_DELIVERY_REPORT
'Add the Recipient of the report (usually the original e-mail sender).
email.Recipients.Add "Exchange_User", "UserAlias@ServerInputQueueLabel", MSMQMAIL_RECIPIENT_TO
'Set subject of original mail.
email.DeliveryReportData.OriginalSubject = "Original subject "
'Set submission time of original mail.
email.DeliveryReportData.OriginalSubmissionTime = CDate("5/20/94 10:16:07 PM")
'Add two delivered recipients.
email.DeliveryReportData.DeliveredRecipients.Add "Exchange_User2", "UserAlias2@ServerInputQueueLabel", MSMQMAIL_RECIPIENT_TO, DeliveryTime:= CDate("5/20/94 10:17:00 PM")
email.DeliveryReportData.DeliveredRecipients.Add "Exchange_User3", "UserAlias3@ServerInputQueueLabel", MSMQMAIL_RECIPIENT_CC, DeliveryTime:= CDate("5/20/94 11:01:00 PM")
'Compose message Body
msg.Body = email.ComposeBody
'*********************
'* Display Delivered Recipients.
'*********************
Dim recipient As MSMQMailRecipient
For Each recipient In email.DeliveryReportData.DeliveredRecipients
MsgBox "Delivered To Recipient: " + recipient.Name + " at " + recipient.Address + " on " + recipient.DeliveryTime
Next recipient
End Sub
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.
Add, Address, ComposeBody, ContentType, FormData, FormFields, MSMQMailEMail, Name, Sender, Subject, DeliveryReportData