SmtpMessageSubmittedToServer Event
Occurs each time the message is 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 SmtpMessageSubmittedToServerEventHandler MessageSubmittedToServer

Value

Type: MailBee.SmtpMailSmtpMessageSubmittedToServerEventHandler
Remarks
If the message is sent to multiple SMTP servers (common case in direct send mode where the message is submitted to SMTP MX server of each recipient domain separately), this event is raised for each SMTP server the message was successfully submitted to.
Examples
This sample sends a message in direct send mode to 3 recipients on 2 domains. MessageSubmittedToServer event is raised 2 times (for each domain).
using System;
using MailBee;
using MailBee.SmtpMail;

class Sample
{
    // MessageSubmittedToServer event handler.
    private static void OnMessageSubmittedToServer(object sender,
        SmtpMessageSubmittedToServerEventArgs e)
    {
        Console.WriteLine(e.AcceptedRecipients.ToString() + " accepted");
    }

    // 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 MessageRecipientSubmitted event.
        mailer.MessageSubmittedToServer +=
            new SmtpMessageSubmittedToServerEventHandler(OnMessageSubmittedToServer);

        // 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();
    }
}
See Also