The RequestNonDeliveryReport property specifies whether a non-delivery report is sent back for the recipients that did not receive the e-mail.
Type: | Boolean |
Run time: | Read-write |
object.RequestNonDeliveryReport
Syntax Element | Description |
---|---|
object | E-mail (MSMQMailEMail) object that represents the e-mail message. |
Boolean (default is False).
If RequestNonDeliveryReport is set to True, the sender receives a non-delivery report for the recipients that did not receive the e-mail.
This example defines a text-message e-mail, setting its RequestNonDeliveryReport to True. The e-mail object is then used to compose the body of a mail message, and a message box displays the e-mail's non-delivery report request.
To try this example using Microsoft Visual Basic (version 5.0), paste the code into the Code window of a form, 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."
'Request non-delivery report.
email.RequestNonDeliveryReport = True
'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 delivery report flag.
'******************
MsgBox "Request a non-delivery report for the e-mail:" + email.RequestNonDeliveryReport
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, Body, ComposeBody, ContentType, MSMQMailEMail, MSMQMessage, Name, Recipients, Sender, Text, TextMessageData