Adds an header field at the end of the MailHeaders object.
The MailHeaders index at which the value has been added.
| Exception Type | Condition |
|---|---|
| ArgumentNullException | key is a null reference (Nothing is Visual Basic). |
| ArgumentException |
key is an empty string -or- The header value is invalid. |
This sample shows how to add and header field to a Mail object.
Mail oMail = new Mail();
oMail.Headers.Add("X-Private-Field", GetPrivateFieldString());
MailHeaders Class | MailMill Namespace | MailHeaders.Add Overload List | Mail | Mail.Headers