public event EventHandler<TEventArgs> Progress
Show how to handle the Progress event.
using System; using ComponentPro.Net.Mail; ... public void ShowProgress() { // Create a new Smtp instance. Smtp client = new Smtp(); // Connect to the SMTP server. client.Connect("myserver"); // Authenticate. client.Authenticate("test", "test"); try { // Register an event handler. client.Progress += client_Progress; // Load an existing mail message. MailMessage msg = new MailMessage("c:\\temp\\my message.eml"); // And send it. client.Send(msg); } catch (SmtpException exc) { Console.WriteLine("Exception: " + exc.Message); } // Disconnect. client.Disconnect(); } void client_Progress(object sender, SmtpProgressEventArgs e) { // Show progress information. if (e.State == SmtpTransferState.Sending) { Console.Write("\rDownloaded: {0} bytes ({1}% completed)", e.BytesTransferred, e.Percentage); } }