SmtpMessageSent Event
Occurs after the message was successfully sent.

Namespace: MailBee.SmtpMail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.4 build 677 for .NET 4.5
public event SmtpMessageSentEventHandler MessageSent


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

        // Subscribe to the MessageSent event.
        mailer.MessageSent += new SmtpMessageSentEventHandler(OnMessageSent);

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