Initializes a new instance of the MailAddresses object with a comma-delimited string of email addresses.
Syntax
| Visual Basic (Usage) | Copy Code |
|---|
Dim SourceString As String
Dim instance As New MailAddresses(SourceString) |
Parameters
- SourceString
Example
The following example demonstrates verifying a list of email addresses.
| Visual Basic | Copy Code |
|---|
' Be sure to import the namespace by putting "Imports Dart.PowerTCP.Mail"
' at the top of your class.
' Create a MailAddresses collection populated with some addresses
Dim ma As New MailAddresses("sales@dart.com,bad@fake.com,support@dart.com")
' Verify the addresses against the specified DNS servers
ma.Verify("206.64.128.5,198.6.1.2,198.6.1.3", 20000)
' Check the response to each address.
Dim m As MailAddress
For Each m In ma
If m.ServerResponse.Code = 250 Then
System.Diagnostics.Debug.WriteLine(m.Address + " is OK")
Else
System.Diagnostics.Debug.WriteLine(m.Address + " is bad")
End If
Next |
| C# | Copy Code |
|---|
// Be sure to import the namespace by putting "using Dart.PowerTCP.Mail;"
// at the top of your class.
// Create a MailAddresses collection populated with some addresses
MailAddresses ma = new MailAddresses("sales@dart.com,bad@fake.com,support@dart.com");
// Verify the addresses against the specified DNS servers
ma.Verify("206.64.128.5,198.6.1.2,198.6.1.3", 20000);
// Check the response to each address.
foreach(MailAddress m in ma)
if(m.ServerResponse.Code == 250)
System.Diagnostics.Debug.WriteLine(m.Address + " is OK");
else
System.Diagnostics.Debug.WriteLine(m.Address + " is bad"); |
Remarks
Requirements
Target Platforms: Microsoft .NET Framework 2.0
See Also