MDNRequested Property
Topic Last Modified: 2006-06-13
Indicates whether a Mail Delivery Notification (MDN) report is requested for a message.
Applies To
Type Library
Microsoft CDO for Exchange 2000 Library
DLL Implemented In
CDOEX.DLL
Syntax
Property MDNRequested As Boolean
HRESULT get_MDNRequested(VARIANT_BOOL* pVal);HRESULT put_MDNRequested(VARIANT_BOOL Val);
Parameters
- pVal
Returns the value of the MDNRequested property as a reference to a VARIANT_BOOL.
- Val
Sets the value of the MDNRequested property to the value of the VARIANT_BOOL.
Remarks
An MDN is a request for disposition information from a recipient after the message has been successfully delivered. This disposition might include whether the message was displayed, printed, or deleted without display, or if a recipient refused to send MDNs. The message sender or an intermediary Message Transfer Agent can request MDNs. The returned MDN report message is nested in a message with Content-Type of multipart/report. RFC 2298 describes MDNs, their function and format.
To request an MDN for a message, set the urn:schemas:mailheader:disposition-notification-to header field to the sender's e-mail address. Optionally, set the urn:schemas:mailheader:disposition-notification-options header field to the appropriate value. Then send the message. To remove a previously added MDN header field, delete it using the IMessage.Fields.Delete method.
Examples
' WSH Source file.
' Assume
' <reference object="adodb.record"/>
' <reference object="cdo.message"/>
' exist to resolve type names using the
' type libraries.
sub mdnexample()
set msg = createobject("cdo.message")
with msg
set conf = .configuration
with conf
.fields(cdoSendEmailAddress) = "user1@example.com"
.fields(cdoSendUserReplyEmailAddress) = "user2@example.com"
.fields.update
end with
.to = "user3@example.com"
.from = "user1@example.com"
.subject = "Need to know you got this."
.textbody = "here is the important message."
.mdnrequested = true
.fields(cdoDispositionNotificationTo) = "user1@example.com"
.fields.update
wscript.echo .getstream.readtext
' .send
' next, send the message to others without MDNs
.fields.delete(cdoDispositionNotificationTo)
.fields.update
.To = "user4@example.com"
wscript.echo .getstream.readtext
' .send
end with
end sub
See the VBScript example.
See the VBScript example.