-
DnsClient.NET
DnsClient.NET is a simple yet very powerful and high performant open source library for the .NET Framework to do DNS lookups
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
// in the top of the file // requires installation of https://www.nuget.org/packages/DnsClient using System.Net; using System.Net.Mail; using DnsClient; MailAddress to = new MailAddress("[email protected]"); MailAddress from = new MailAddress("[email protected]"); MailMessage message = new MailMessage(from, to); message.Subject = "See you Monday?"; message.Body = "Elizabeth, I didn't hear back from you. Let me know if we're still scheduled for Monday."; LookupClient lookup = new LookupClient(); IDnsQueryResponse response = lookup.Query("westminster.co.uk", QueryType.MX); foreach(DnsClient.Protocol.MxRecord record in response.Answers) { Console.WriteLine(ObjectDumper.Dump(record.Exchange)); SmtpClient client = new SmtpClient(record.Exchange, 25); try { client.Send(message); // if we reached this point, our email was sent and we can break the loop break; } catch(SmtpException ex) { Console.WriteLine(ex.ToString()); } }