| Visual Basic (Declaration) | |
|---|---|
<BrowsableAttribute(False)> Public ReadOnly Property DSN As DeliveryStatusNotification | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As Smtp Dim value As DeliveryStatusNotification value = instance.DSN | |
| C# | |
|---|---|
[BrowsableAttribute(false)] public DeliveryStatusNotification DSN {get;} | |
| Managed Extensions for C++ | |
|---|---|
[BrowsableAttribute(false)] public: __property DeliveryStatusNotification* get_DSN(); | |
| C++/CLI | |
|---|---|
[BrowsableAttribute(false)] public: property DeliveryStatusNotification^ DSN { DeliveryStatusNotification^ get(); } | |
Property Value
The DeliveryStatusNotification object to control DNS use.| Visual Basic | Copy Code |
|---|---|
' Be sure to import the namespace by putting "Imports Dart.PowerTCP.Mail" ' at the top of your class. ' Specify a DSN ID to use. Smtp1.DSN.EnvelopeID = "ID1234567" ' Specify to return the entire message instead of the headers. Smtp1.DSN.ReturnMessage = True ' Send a DSN on failure or delay. Smtp1.DSN.Type = DSNType.Delay Or DSNType.Failure ' Send a message Smtp1.Server = "mail@test.com" Smtp1.Send("you@test.com", "me@test.com", "Test", "test message") | |
| C# | Copy Code |
|---|---|
// Be sure to import the namespace by putting "using Dart.PowerTCP.Mail;" // at the top of your class. // Specify a DSN ID to use. smtp1.DSN.EnvelopeID = "ID1234567"; // Specify to return the entire message instead of the headers. smtp1.DSN.ReturnMessage = true; // Send a DSN on failure or delay. smtp1.DSN.Type = DSNType.Delay | DSNType.Failure; // Send a message smtp1.Server = "mail.test.com"; smtp1.Send("you@test.com", "me@test.com", "Test", "test message"); | |
Because the support for notification of the success or failure of a sent message was quite limited, RFC 1891 defined an extension to the SMTP protocol to allow for Delivery Status Notification, or DSN. DSN allows much greater control over what conditions should the sender be notified and the construction of the notification itself. This was achieved by extending the SMTP RCPT and MAIL commands to allow the specification of notification parameters. These parameters include:
- A NOTIFY parameter (appended to RCPT command) to specify under what conditions the sender should be notified (NEVER, SUCCESS, FAILURE, or DELAY).
- A RET parameter (appended to MAIL command) to specify whether or not the message should be included in the DSN.
- A ENVID parameter (appended to MAIL command) specifying an envelope identifier to be transmitted with the DSN.
- A ORCPT parameter (appended to RCPT command) specifying the original recipient.
The properties of the DeliveryStatusNotification object control the use of these parameters:
- Set DeliveryStatusNotification.Type to specify under what conditions a DSN should be sent (DSNType.Default, DSNType.Delay, DSNType.Failure, DSNType.Never, or DSNType.Success).
- Set DeliveryStatusNotification.ReturnMessage to true to specify that the entire message should be included with the DSN, and false if only the header should be included.
- Set DeliveryStatusNotification.EnvelopeID to the envelope identifier to be transmitted with the DSN.
Once the properties of the DeliveryStatusNotification object have been set, all DSN related communication will occur transparently. The ORCPT parameter is automatically added and set to the recipient.
Target Platforms: Microsoft .NET Framework 2.0
Copy Code