PowerTCP Mail for .NET
DeliveryStatusNotification Property
Example 




Gets or sets the DeliveryStatusNotification object that specifies Delivery Status Notification.
Syntax
Public Property DeliveryStatusNotification As DeliveryStatusNotification
Dim instance As Smtp
Dim value As DeliveryStatusNotification
 
instance.DeliveryStatusNotification = value
 
value = instance.DeliveryStatusNotification
public DeliveryStatusNotification DeliveryStatusNotification {get; set;}
public: __property DeliveryStatusNotification* get_DeliveryStatusNotification();
public: __property void set_DeliveryStatusNotification( 
   DeliveryStatusNotification* value
);
public:
property DeliveryStatusNotification^ DeliveryStatusNotification {
   DeliveryStatusNotification^ get();
   void set (    DeliveryStatusNotification^ value);
}
Example
This example demonstrates sending a message with Delivery Status Notification (DSN).
using System.Net.Mail;

private void sendWithDsn()
{
    //Specify a DSN ID to use
    smtp1.DeliveryStatusNotification.EnvelopeID = "ID1234567";

    //Return the entire message instead of the headers
    smtp1.DeliveryStatusNotification.ReturnMessage = true;

    //Send a DSN on failure or delay
    smtp1.DeliveryStatusNotification.Options = DeliveryNotificationOptions.Delay | DeliveryNotificationOptions.OnFailure;

    //Send a message
    smtp1.Session.RemoteEndPoint = new IPEndPoint(myServer, Smtp.GetDefaultPort(smtp1.Session));
    smtp1.Session.Username = myUsername;
    smtp1.Session.Password = myPassword;
    smtp1.Send(toAddress, fromAddress, "Test", "Test Message.");
    //Gracefully logout
    smtp1.Close();
}
Imports System.Net.Mail

Private Sub sendWithDsn()
    'Specify a DSN ID to use
    smtp1.DeliveryStatusNotification.EnvelopeID = "ID1234567"

    'Return the entire message instead of the headers
    smtp1.DeliveryStatusNotification.ReturnMessage = True

    'Send a DSN on failure or delay
    smtp1.DeliveryStatusNotification.Options = DeliveryNotificationOptions.Delay Or DeliveryNotificationOptions.OnFailure

    'Send a message
    smtp1.Session.RemoteEndPoint = New IPEndPoint(myServer, Smtp.GetDefaultPort(smtp1.Session))
    smtp1.Session.Username = myUsername
    smtp1.Session.Password = myPassword
    smtp1.Send(toAddress, fromAddress, "Test", "Test Message.")
    'Gracefully logout
    smtp1.Close()
End Sub
See Also

Reference

Smtp Class
Smtp Members


PowerTCP Mail for .NET Documentation Version 4.3
© 2018 Dart Communications. All Rights Reserved.
Send comments on this topic