Adds an header field at the end of the MailHeaders object.
The MailHeaders index at which the value has been added.
value must be of type DictionaryEntry and value.Key must be of type string otherwise an error occurs.
| Exception Type | Condition |
|---|---|
| ArgumentNullException | value is a null reference (Nothing is Visual Basic). |
| ArgumentException |
value is not of type DictionaryEntry -or- value is not a valid header field. |
This sample shows how to add a DictionaryEntry containing an header field to a Mail object.
Mail oMail = new Mail();
DictionaryEntry de = new DictionaryEntry("X-Private-Field", GetPrivateFieldString());
oMail.Headers.Add(de);
MailHeaders Class | MailMill Namespace | MailHeaders.Add Overload List | System.String | System.Collections.DictionaryEntry | Mail | Mail.Headers