Skip to content

Custom Headers

Andrew Theken edited this page Dec 11, 2014 · 4 revisions

You may add custom smtp headers to any message. These may be useful for parsing messages later or for special use cases with your application.

var message = new PostmarkMessage();`

message.To = "someone@someplace.com";
message.Cc = "someoneelse@someplace.com";
message.Subject = "Custom Headers!";
message.Textbody = "Some plain text";
message.From = "you@yourdomain.com";
message.Headers = new NameValueCollection { { "X-CUSTOM-HEADER", "value" } },

var newClient = new PostmarkClient("server_token");

var response = newClient.SendMessage(message);

Usually header names are in the form X-Custom-Header, where the X- prefix indicates an "extension" header.

Extension headers are any non-standard headers you wish to include to better track messages, or in some cases, target added client behaviors.

Clone this wiki locally