Mail DSNHeaders Collection

The Mail.DSNHeaders collection contains the list of header fields contained in a DSN message. See the Collection Object for standard collection properties and methods.

Syntax

Item = Mail.DSNHeaders(key|index)

Parameters
key
The identifier for the item to return.
index
An index offset indicating which item in the list to return. The index starts at 0
Return Value

Returns a Variant of type String.

Remarks

The DSNHeaders collection may contain the following field:

Original-Envelope-ID Contains an "envelope identifier" which uniquely identifies the transaction during which the message was submitted. This fields correspond to what is set using the Mail.DSNEnvID property.
Reporting-MTA Indicates the MTA which attempted to perform the delivery, relay, or gateway operation described in the DSN. This field is always present.
DSN-Gateway Indicates the name of the gateway or MTA which translated a foreign (non-Internet) delivery status notification into this DSN
Received-From-MTA Indicates the name of the MTA from which the message was received.
Arrival-Date Indicates the date and time at which the message arrived at the Reporting MTA.

See RFC1894 for details about DSN messages.

Example

The following example uses the Original-Envelope-ID to link back to the original receivers database record

Sub Mail_OnReceiveMail
    If Mail.DSNHeaders("Original-Envelope-ID") <> "" Then
        sSQL = "SELECT * FROM MyContacts WHERE ContactID=" & Mail.DSNHeaders("Original-Envelope-ID")
        ' Execute SQL query...
        ' Update record...
    End If
End Sub

Applies To

Mail Object

See Also

DSNReceivers, DSNEnvID, Collection Object

 
©2001-2015 Active+ Software. All trademarks property of their owners.