aspNetEmail

DirectSend.AddDnsServer Method (IPAddress)

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

public static void AddDnsServer(
   IPAddress ipAddress
);

Parameters

ipAddress
An IPAddress of the DNS server.

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( IPAddress.Parse( "10.0.96.1" ) );
            DirectSend.AddDnsServer( IPAddress.Parse( "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(IPAddress.Parse("10.0.96.1"))
            DirectSend.AddDnsServer(IPAddress.Parse("10.0.96.2"))
            DirectSend.Send(m)
            
            

See Also

DirectSend Class | aspNetEmail Namespace | DirectSend.AddDnsServer Overload List