PowerTCP Mail for .NET
Headers Property
Example 




Provides a Headers instance that lists all unique header fields.
Syntax
Public Property Headers As HeaderDictionary
Dim instance As Part
Dim value As HeaderDictionary
 
instance.Headers = value
 
value = instance.Headers
public HeaderDictionary Headers {get; set;}
public: __property HeaderDictionary* get_Headers();
public: __property void set_Headers( 
   HeaderDictionary* value
);
public:
property HeaderDictionary^ Headers {
   HeaderDictionary^ get();
   void set (    HeaderDictionary^ value);
}
Remarks
Any duplicate header field names found during decoding are stored in Duplicates. They are subsequently reused during encoding of the Header.
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

Part Class
Part Members


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