| Visual Basic (Declaration) | |
|---|---|
Public Property DnsServers As StringCollection | |
| Visual Basic (Usage) | Copy Code |
|---|---|
Dim instance As Smtp Dim value As StringCollection instance.DnsServers = value value = instance.DnsServers | |
| C# | |
|---|---|
public StringCollection DnsServers {get; set;} | |
| Managed Extensions for C++ | |
|---|---|
public: __property StringCollection* get_DnsServers(); public: __property void set_DnsServers( StringCollection* value ); | |
| C++/CLI | |
|---|---|
public: property StringCollection^ DnsServers { StringCollection^ get(); void set ( StringCollection^ value); } | |
Property Value
StringCollection contains a list of DNS servers used to lookup mail server information.Set the DnsServer property to a list of one or more DNS servers, and leave the Smtp.MailServer property empty to enable the sending of email messages directly to the recipient’s mail server.
This list is an ordered list; the first server will be attempted and if no response is received within the Smtp.DnsServerTimeout period, the next server in the list will be tried.
The system automatically populates the default DNS servers; you should only need to add to this list if the default DNS servers are not adequate.
If the message is being sent to many different recipient domains, the direct sending of messages can be many times slower than using a MailServer, since the Smtp control is now doing all the work normally done by a relay mail server.
Target Platforms: Microsoft .NET Framework 2.0
Copy Code