SmtpMessageDirectSendDone Event
Occurs in direct send mode when the component finished submitting the mail message to all SMTP MX servers of recipients domains.

Namespace: MailBee.SmtpMail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.4 build 677 for .NET 4.5
public event SmtpMessageDirectSendDoneEventHandler MessageDirectSendDone


Type: MailBee.SmtpMailSmtpMessageDirectSendDoneEventHandler
In direct send mode, MessageDirectSendDone event is immediately followed by MessageSent event. However, if some recipients of the message failed and SmtpServers collection contains low priority SMTP relay servers (with priority value lower than top priority DNS server in DnsServers collection), the component will attempt to send the message to the failed recipients using these low priority SMTP relay servers. In this case, MessageSent event is raised noticeably later than MessageDirectSendDone event (after the message was also sent to the backup SMTP relay servers).
This sample sends a message in direct send mode to 3 recipients on 2 domains. MessageDirectSendDone event is raised 1 time. However, a backup SMTP relay server is then used in order to send to the recipients failed during direct send. MessageDirectSendDone and MessageSent events are raised 1 time.
using System;
using MailBee;
using MailBee.SmtpMail;

class Sample
    // MessageDirectSendDone event handler.
    private static void OnMessageDirectSendDone(object sender,
        SmtpMessageDirectSendDoneEventArgs e)
        Console.WriteLine("Sent using direct send to: " +

    // MessageSent event handler.
    private static void OnMessageSent(object sender,
        SmtpMessageSentEventArgs e)
        Console.WriteLine("In the long run, sent to: " +

    // The actual code.
    static void Main(string[] args)
        Smtp mailer = new Smtp();

        // Get DNS servers from config file/OS settings.

        // Specify backup SMTP server and enable ESMTP authentication.
        // Note, depending on your SMTP server settings, either 
        // "jdoe" or "" should be used as user account name.
        SmtpServer server = new SmtpServer("", "jdoe", "secret");
        server.Priority = 100; // low priority

        // Subscribe to events.
        mailer.MessageDirectSendDone +=
            new SmtpMessageDirectSendDoneEventHandler(OnMessageDirectSendDone);
        mailer.MessageSent += new SmtpMessageSentEventHandler(OnMessageSent);

        // Send a message to 3 recipients on 2 domains. Let's assume we send 
        // from a domain which has no its own MX record, and checks 
        // this and rejects our message to In this case, 
        // the message will be delivered to using ISP's mail 
        // server (we assume ISP's mail server has MX record assigned).
        mailer.To.AsString = ",,";
        mailer.From.Email = "";
        mailer.Subject = "Test message";
See Also