SmtpMessageSent Event
Occurs after the message was successfully sent.

Namespace: MailBee.SmtpMail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
Syntax
public event SmtpMessageSentEventHandler MessageSent

Value

Type: MailBee.SmtpMailSmtpMessageSentEventHandler
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 after the message was submitted to all SMTP servers.
Examples
This sample sends a message in direct send mode to 3 recipients on 2 domains. MessageSent event is raised 1 time.
using System;
using MailBee;
using MailBee.SmtpMail;

class Sample
{
    // MessageSent event handler.
    private static void OnMessageSent(object sender, SmtpMessageSentEventArgs e)
    {
        Console.WriteLine("Sent to: " + e.SuccessfulRecipients.ToString());
    }

    // 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 MessageSent event.
        mailer.MessageSent += new SmtpMessageSentEventHandler(OnMessageSent);

        // 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