SmtpGetTxtData Method
Retrieves the list of TXT strings of DNS data of the specified domain.

Namespace: MailBee.SmtpMail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.4 build 677 for .NET 4.5
public string[] GetTxtData(
	string domain


Type: SystemString
The domain to get the list of MX hosts for.

Return Value

Type: String
The array of strings taken from DNS TXT data of the specified domain, or a null reference (Nothing in Visual Basic) if an error occurred or no TXT record found for the given domain.
MailBeeInvalidArgumentExceptiondomain is a null reference (Nothing in Visual Basic).
MailBeeExceptionAn error occurred and ThrowExceptions is true.

This method makes DNS TXT query to the servers listed in DnsServers collection regarding domain. The method supports multiple strings per TXT record and multiple TXT records per domain. If multiple TXT records are returned, their arrays of strings are concatenated into single array.

TXT records contain important DNS information used by various antispam techniques like SPF and DomainKeys (DKIM).

This sample retrieves TXT information for "" domain.
using System;
using MailBee;
using MailBee.SmtpMail;

class Sample
    static void Main(string[] args)
        Smtp mailer = new Smtp();
        string[] strings = mailer.GetTxtData("");
        foreach (string str in strings)
See Also