SmtpHostResolved Event |
Namespace: MailBee.SmtpMail
If the SMTP server name was already specified as an IP address, this event is still raised.
When the POP3 server name is resolved into IP address (if POP-before-SMTP authentication is used), this event is raised as well.
Note |
---|
No checking if performed on whether the resolved IP address points to the live host. |
using System; using MailBee; using MailBee.SmtpMail; class Sample { // HostResolved event handler. private static void OnHostResolved(object sender, HostResolvedEventArgs e) { foreach (System.Net.IPAddress ip in e.RemoteHost.AddressList) { Console.WriteLine(ip.ToString()); } } // The actual code. static void Main(string[] args) { Smtp mailer = new Smtp(); mailer.SmtpServers.Add("smtp.domain.com"); // Subscribe to the HostResolved event. mailer.HostResolved += new HostResolvedEventHandler(OnHostResolved); mailer.Connect(); mailer.Disconnect(); } }