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.4 build 677 for .NET 4.5
public event SmtpMessageSenderSubmittedEventHandler MessageSenderSubmitted


Type: MailBee.SmtpMailSmtpMessageSenderSubmittedEventHandler
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).
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.

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

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

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