SmtpLoggedIn Event |
Namespace: MailBee.SmtpMail
using System; using MailBee; using MailBee.SmtpMail; class Sample { // LoggedIn event handler. private static void OnLoggedIn(object sender, LoggedInEventArgs e) { Console.WriteLine("Successfully authenticated on the SMTP server"); } // The actual code. static void Main(string[] args) { Smtp mailer = new Smtp(); // Specify SMTP server and enable ESMTP authentication. // Note, depending on your SMTP server settings, either jdoe or jdoe@domain.com // should be used as user account name. mailer.SmtpServers.Add("smtp.domain.com", "jdoe@domain.com", "secret"); // Subscribe to the LoggedIn event. mailer.LoggedIn += new LoggedInEventHandler(OnLoggedIn); mailer.Connect(); mailer.Hello(); mailer.Login(); mailer.Disconnect(); } }