PowerTCP Mail for .NET
Add(String,HeaderField) Method
Example 




Header field name. Must equal Name.
Header field to add.
Adds a header field to the dictionary.
Syntax
Public Overloads Shadows Sub Add( _
   ByVal key As String, _
   ByVal value As HeaderField _
) 
Dim instance As HeaderDictionary
Dim key As String
Dim value As HeaderField
 
instance.Add(key, value)
public new void Add( 
   string key,
   HeaderField value
)
public: new void Add( 
   string* key,
   HeaderField* value
) 
public:
new void Add( 
   String^ key,
   HeaderField^ value
) 

Parameters

key
Header field name. Must equal Name.
value
Header field to add.
Example
This example demonstrates how to add a custom header field to a message.
private MailMessage addCustomHeaderField(MailMessage message)
{
    //Add the following header to the message:
    //My-Custom-Header: This is a custom header
    message.Headers.Add("My-Custom-Header", new HeaderField("My-Custom-Header", "This is a custom header"));
    return message;
}
Private Function addCustomHeaderField(ByVal message As MailMessage) As MailMessage
    'Add the following header to the message:
    'My-Custom-Header: This is a custom header
    message.Headers.Add("My-Custom-Header", New HeaderField("My-Custom-Header", "This is a custom header"))
    Return message
End Function
See Also

Reference

HeaderDictionary Class
HeaderDictionary Members
Overload List


PowerTCP Mail for .NET Documentation Version 4.3
© 2018 Dart Communications. All Rights Reserved.
Send comments on this topic