SmtpMessageMXLookupDone Event
Occurs in direct send mode after the component finished DNS MX lookup of 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 SmtpMessageMXLookupDoneEventHandler MessageMXLookupDone


Type: MailBee.SmtpMailSmtpMessageMXLookupDoneEventHandler
If the message is sent without SMTP relay server directly to MX servers of recipient domains, the component must first discover these servers by performing MX lookup queries to DNS servers. Once this process is finished, the component raises MessageMXLookupDone and starts submitting the mail message to the discovered MX servers.
This sample sends a message in direct send mode to 3 recipients on 2 domains. MessageMXLookupDone event is raised 1 time.
using System;
using System.Collections;
using MailBee;
using MailBee.SmtpMail;

class Sample
    // MessageMXLookupDone event handler.
    private static void OnMessageMXLookupDone(object sender,
        SmtpMessageMXLookupDoneEventArgs e)
        // Create and display comma-separated list of domains for which 
        // SMTP MX servers have been found.
        string domains = string.Join(", ",

        Console.WriteLine("Will send to MX servers of the following domains: " + domains);

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

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

        // Subscribe to the MessageMXLookupDone event.
        mailer.MessageMXLookupDone +=
            new SmtpMessageMXLookupDoneEventHandler(OnMessageMXLookupDone);

        // Send a message to 3 recipients on 2 domains.
        mailer.To.AsString = ",,";
        mailer.From.Email = "";
        mailer.Subject = "Test message";

        Console.WriteLine("Sent to: " + mailer.GetAcceptedRecipients().ToString());
See Also