-
Notifications
You must be signed in to change notification settings - Fork 46
Custom Headers
Andrew Theken edited this page Dec 11, 2014
·
2 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.
The Postmark.Net client can be installed from NuGet.
For additional information about the capabilities of the Postmark API, see http://developer.postmarkapp.com/.
- Getting Started
- Version 2.0 Upgrade Guide
- Sending Email
- Searching Sent Messages
- Analyzing Sent Messages
- Processing Inbound Email
- Retrieving Message Statistics
- Handling Bounces
- Managing Suppressions
- Working with Message Streams
- Managing Your Account
- Troubleshooting Async&Await
- Version 1.x Overview
- Sending Email
- Sending Batch Emails
- Sending Attachments
- Sending Inline Images
- Using
MailMessage
- Using the Bounce API
- [Getting Send Statistics](Sending Statistics)
- Adding Custom Email Headers