EmailAddressCollectionRemove Method
Removes the specified e-mail address from the collection.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax
public void Remove(
	string email
)

Parameters

email
Type: SystemString
Actual e-mail address to be deleted (i.e. user@domain.com).
Exceptions
ExceptionCondition
MailBeeInvalidArgumentExceptionemail is a null reference (Nothing in Visual Basic).
Remarks

If the specified e-mail address appears multiple times in the collection, all such entries will be removed.

To remove the e-mail address from the collection by the index, the developer should use RemoveAt(Int32) method.

Examples
This sample adds some e-mail addresses into To: field and then removes one of them.
// To use the code below, import MailBee namespaces at the top of your code.
using MailBee;
using MailBee.Mime;

MailMessage msg = new MailMessage();

msg.To.Add("user1@domain.com");
msg.To.Add("user2@domain.com", "User 2");
msg.To.Add("user3@domain.com", null, "User 3");

Console.WriteLine(msg.To.ToString());

msg.To.Remove("user2@domain.com");

Console.WriteLine(msg.To.ToString());
See Also