// Send an email with the Postmark .NET library
// Learn more -> https://postmarkapp.com/developer/integration/official-libraries#dot-net
// Install with NuGet
PM> Install-Package Postmark
// Import
using PostmarkDotNet;
// Example request
PostmarkMessage message = new PostmarkMessage {
From = "sender@example.com",
To = "receiver@example.com",
Subject = "Hello from Postmark",
HtmlBody = "<strong>Hello</strong> dear Postmark user.",
TextBody = "Hello dear postmark user.",
ReplyTo = "reply@example.com",
TrackOpens = true,
Headers = new NameValueCollection {{ "CUSTOM-HEADER", "value" }}
};
PostmarkClient client = new PostmarkClient("POSTMARK_API_TEST");
PostmarkResponse response = client.SendMessage(message);
if(response.Status != PostmarkStatus.Success) {
Console.WriteLine("Response was: " + response.Message);
}