aspNetEmail

DirectSend.AddDnsServer Method (String)

Adds a DNS Server to be used by the DirectSend class for DNS queries.

public static void AddDnsServer(
   string ipString
);

Parameters

ipString
An IPAddress formatted string (ex: "10.0.0.1" )

Example

[C#]
            EmailMessage m = new EmailMessage();
            m.From = "john@example.com";
            m.To = "you@yourcompany.com";
            m.Subject = "example email";
            m.Body = "your body contents go here...";
            m.LogPath = "c:\\email.log";
            m.Logging = true;
            
            //Add DNS servers to use for lookup
            DirectSend.AddDnsServer( "10.0.96.1" );
            DirectSend.AddDnsServer( "10.0.96.2" );
            DirectSend.Send( m );
            
[VB.NET]
            Dim m As New EmailMessage()
            m.From = "john@example.com"
            m.To = "you@yourcompany.com"
            m.Subject = "example email"
            m.Body = "your body contents go here..."
            m.LogPath = "c:\email.log"
            m.Logging = True
            
            'Add DNS servers to use for lookup
            DirectSend.AddDnsServer("10.0.96.1")
            DirectSend.AddDnsServer("10.0.96.2")
            DirectSend.Send(m)
            
            

See Also

DirectSend Class | aspNetEmail Namespace | DirectSend.AddDnsServer Overload List