SmtpMessageSenderSubmitted Event
Occurs after the sender of the mail message was successfully submitted to the SMTP server.

Namespace: MailBee.SmtpMail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax
public event SmtpMessageSenderSubmittedEventHandler MessageSenderSubmitted

Value

Type: MailBee.SmtpMailSmtpMessageSenderSubmittedEventHandler
Remarks
If the message is being sent to multiple SMTP servers (such as to SMTP MX servers in direct mode), this event will be raised multiple times (once per each individual SMTP connection).
Examples
This sample sends a message in direct send mode to 3 recipients on 2 domains. MessageSenderSubmitted event is raised 2 times (for each domain).
Note Note
In some cases, it may be raised more than 2 times. If certain domain has more than one SMTP MX server assigned, and sending to high-priority MX server failed after the message sender has already been submitted, then backup MX servers are tried (so that the message sender is submitted again, and so does MessageSenderSubmitted event).
using System;
using MailBee;
using MailBee.SmtpMail;

class Sample
{
    // MessageSenderSubmitted event handler.
    private static void OnMessageSenderSubmitted(object sender,
        SmtpMessageSenderSubmittedEventArgs e)
    {
        Console.WriteLine("SMTP server accepted " + e.SenderEmail + " address");
    }

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

        // Get DNS servers from config file/OS settings.
        mailer.DnsServers.Autodetect();

        // Subscribe to the MessageSenderSubmitted event.
        mailer.MessageSenderSubmitted +=
            new SmtpMessageSenderSubmittedEventHandler(OnMessageSenderSubmitted);

        // Send a message to 3 recipients on 2 domains.
        mailer.To.AsString = "user1@domain1.com, user2@domain1.com, user2@domain2.com";
        mailer.From.Email = "sender@domain.com";
        mailer.Subject = "Test message";
        mailer.Send();

        Console.WriteLine("Message sent to: " + mailer.GetAcceptedRecipients().ToString());
    }
}
See Also