Add Method (TOs, CCs, BCCs and ReplyTOs collections)

Dundas

Add Method (TOs, CCs, BCCs and ReplyTOs collections)

Adds an Address object to the relevant collection.

Syntax

Collection.Add (Address as string, [Name as string])

The Add method syntax has the following parts:

Part

Description

Address

An email address to send the message to.

Name

Optional. The "name" of the email recipient.

  Remarks

Use this method to add an Address object to the specified collection. The email will be sent to every Address object in the collection. To remove an Address use the Remove method. To remove all addresses from the collection call the Clear method.

The optional Name argument lets you specify a user-friendly name which will appear in the appropriate field of the email (i.e. To, CC, BCC or ReplyTo fields). For example, let's assume that the specified address for John Doe is "[email protected]". If we also set the Name argument to "John Doe" then the recipient of the email will see either "John Doe" <[email protected]> or "John Doe", depending on the email program the client is using.

NOTE: one of these collections needs to have an Address object in order for the SendMail operation to proceed. If none of these collections have been populated then the SendMail operation will immediately fail since no destination address has been specified.

See Also: TOs, CCs, BCCs and ReplyTOs collections | Clear Method | Count Property | Item Method | Remove Method