Recipients Property  
 

Returns the number of recipients specified in the current message.

Syntax

object.Recipients

Remarks

The Recipients property returns the number of recipient addresses that have been specified in the current message. This includes all of the addresses listed in the To, Cc and Bcc header fields. This property can be used in conjunction with the Recipient property array to enumerate all of the recipient addresses in the message.

The AllRecipients property will return a comma-separated list of all message recipients.

Data Type

Integer (Int32)

Example

The following example demonstrates how to use the Recipient property array and the Recipients property:

' Create a comma separated list of all of the recipient email
' addresses currently specified in the message
Dim strRecipients As String

For nIndex = 0 To MailMessage1.Recipients - 1
  If Len(strRecipients) > 0 Then strRecipients = strRecipients & ", "
  strRecipients = strRecipients & MailMessage1.Recipient(nIndex)
Next

See Also

AllRecipients Property, Bcc Property, Cc Property, Recipient Property, To Property