HeaderCollectionExists Method
Checks whether a header with the given name exists in the collection.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
Syntax
public bool Exists(
	string name
)

Parameters

name
Type: SystemString
The name of the header.

Return Value

Type: Boolean
true if the collection contains the header with the specified name; otherwise, false.
Examples
This sample creates the new message and adds a custom header if it does not yet exist.
// To use the code below, import MailBee namespaces at the top of your code.
using MailBee;
using MailBee.Mime;

MailMessage msg = new MailMessage();
if (!msg.Headers.Exists("X-MyHeader"))
{
    msg.Headers.Add("X-MyHeader", "some value for the header", false);
}
See Also