SocketTools .NET Edition

SmtpClient.AddRecipient Method 

Add an address to the recipient list for the current message.

[Visual Basic]
Public Function AddRecipient( _
   ByVal address As String _
) As Boolean
[C#]
public bool AddRecipient(
   string address
);

Parameters

address
A string which specifies the recipient address.

Return Value

This method returns a boolean value. If the method succeeds, the return value is true. If the method fails, the return value is false. To get extended error information, check the value of the LastError property.

Remarks

The AddRecipient method adds the specified address to the recipient list for the current message. This method should be called after the message transaction has begun with a call to the CreateMessage method. Most servers impose a limit of approximately 100 recipient addresses that will be accepted for a single message.

Note that this method does not update the Recipient property, which maintains an internal list of recipient addresses used by the SendMessage method. This method should only be used in conjunction with the CreateMessage method.

See Also

SmtpClient Class | SocketTools Namespace