Table of Contents

Class EmailAddressCollection

Namespace
Microsoft.Exchange.WebServices.Data
Assembly
Microsoft.Exchange.WebServices.dll

Represents a collection of e-mail addresses.

public sealed class EmailAddressCollection : ComplexPropertyCollection<EmailAddress>, IEnumerable<EmailAddress>, IEnumerable
Inheritance
EmailAddressCollection
Implements
Inherited Members

Methods

Add(EmailAddress)

Adds an e-mail address to the collection.

public void Add(EmailAddress emailAddress)

Parameters

emailAddress EmailAddress

The e-mail address to add.

Add(string)

Adds an e-mail address to the collection.

public EmailAddress Add(string smtpAddress)

Parameters

smtpAddress string

The SMTP address used to initialize the e-mail address.

Returns

EmailAddress

An EmailAddress object initialized with the provided SMTP address.

Add(string, string)

Adds an e-mail address to the collection.

public EmailAddress Add(string name, string smtpAddress)

Parameters

name string

The name used to initialize the e-mail address.

smtpAddress string

The SMTP address used to initialize the e-mail address.

Returns

EmailAddress

An EmailAddress object initialized with the provided SMTP address.

AddRange(IEnumerable<EmailAddress>)

Adds multiple e-mail addresses to the collection.

public void AddRange(IEnumerable<EmailAddress> emailAddresses)

Parameters

emailAddresses IEnumerable<EmailAddress>

The e-mail addresses to add.

AddRange(IEnumerable<string>)

Adds multiple e-mail addresses to the collection.

public void AddRange(IEnumerable<string> smtpAddresses)

Parameters

smtpAddresses IEnumerable<string>

The SMTP addresses used to initialize the e-mail addresses.

Clear()

Clears the collection.

public void Clear()

Remove(EmailAddress)

Removes an e-mail address from the collection.

public bool Remove(EmailAddress emailAddress)

Parameters

emailAddress EmailAddress

The e-mail address to remove.

Returns

bool

True if the email address was successfully removed from the collection, false otherwise.

RemoveAt(int)

Removes an e-mail address from the collection.

public void RemoveAt(int index)

Parameters

index int

The index of the e-mail address to remove.