OriginalEmail
MSMQMailNonDeliveryReportData

The OriginalEmail property specifies the original e-mail in a non-delivery report e-mail.

Type: String
Run time: Read-write

Syntax

object1.object2.OriginalEMail
 
Syntax Element Description
Object1 E-mail (MSMQMailEMail) object that defines the e-mail report.
Object2 Non-delivery report data (MSMQMailNonDeliveryReportData) object that represents the non-delivery report information.

Settings

The original e-mail that was not delivered.

Remarks

OriginalEMail should be set to the original e-mail.

Example

This example defines a non-delivery report, adding two non-delivered recipients to the non-delivered recipient list of the report. The e-mail object is composed into a mail message, and each non-delivered recipient is displayed.

To try this example using Microsoft® Visual Basic® (version 5.0), build an original e-mail object, 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 non-delivery report.
   email.ContentType = MSMQMAIL_EMAIL_NON_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 original mail.
   Set email.NonDeliveryReportData.OriginalEMail = emailOrig
   
  'Add two non-delivered recipients.
   email.NonDeliveryReportData.NonDeliveredRecipients.Add "Exchange_User2", "UserAlias2@ServerInputQueueLabel", MSMQMAIL_RECIPIENT_TO, NonDeliveryReason:= "Recipient was not available at this address"
email.NonDeliveryReportData.NonDeliveredRecipients.Add "Exchange_User3", "UserAlias3@ServerInputQueueLabel", MSMQMAIL_RECIPIENT_CC, NonDeliveryReason:= "Communication failure"
 
   'Compose message Body
   msg.Body = email.ComposeBody


   '********************************
   '* Display non-delivered recipients.
   '********************************

   Dim recipient As MSMQMailRecipient

   For Each recipient In email.NonDeliveryReportData.NonDeliveredRecipients
       MsgBox "Not Delivered To Recipient: " + recipient.Name + " at " + recipient.Address + ", Reason is:" + recipient.NonDeliveryReason
   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, Address, Body, ComposeBody, ContentType, MSMQMailEMail, MSMQMessage, Name, Recipients, Sender, Text, TextMessageData