PowerTCP Mail for .NET
MailAddresses Constructor(String)
See Also  Example Send comments on this topic.
Dart.PowerTCP.Mail Namespace > MailAddresses Class > MailAddresses Constructor : MailAddresses Constructor(String)




SourceString
Initializes a new instance of the MailAddresses object with a comma-delimited string of email addresses.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal SourceString As String _
)
Visual Basic (Usage)Copy Code
Dim SourceString As String
 
Dim instance As New MailAddresses(SourceString)
C# 
public MailAddresses( 
   string SourceString
)
Managed Extensions for C++ 
public: MailAddresses( 
   string* SourceString
)
C++/CLI 
public:
MailAddresses( 
   String^ SourceString
)

Parameters

SourceString

Example

The following example demonstrates verifying a list of email addresses.
Visual BasicCopy 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

This constructor initializes the MailAddresses object with a string of email addresses delimited by commas.

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

Documentation Version 3.2
© 2010 Dart Communications. All Rights Reserved.