Add a list of e-mail addresses to the collection.
Public Sub Add ( _ addresses As String _ )
Dim instance As MailAddressCollection Dim addresses As String instance.Add(addresses)
public void Add( string addresses )
public: void Add( String^ addresses )
public function Add( addresses : String )
The addresses parameter is null.
The addresses parameter is an empty string.
The addresses parameter contains an e-mail address that is invalid or not supported.
If multiple e-mail addresses separated with a semicolon character (";") are passed in the addresses parameter. a FormatException exception is raised.
Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98
It seems that this version of the method does not support characters that need to be encoded in the display name, it raises a IndexOutOfRangeException in System.Net.Mime.MailBnfHelper.ReadQuotedString(string data, ref int offset, System.Text.StringBuilder builder, bool doesntRequireQuotes).Call the other overload this way :
MailAddressCollection addresses = new MailAddressCollection();addresses.Add(new MailAddress(address));