-
Notifications
You must be signed in to change notification settings - Fork 46
Getting Started
Getting started with Postmark is very easy. Let's talk about pre-requisites:
- A Postmark Account: Sign up for a new account.
- A "Server Token": Set up a new 'server' in your account.
- A "Sender Signature": Create a sender signature.
Postmark is designed to make sending email super easy, the following snippet shows how easy it is to get started:
public async Task SendTestMessage(){
var client = new PostmarkClient("<server token>");
try{
var sendResult = await client.SendMessageAsync("<sender signature>",
"ben@example.com",
"Hello from Postmark!",
"This is just a friendly hello from your friends at Postmark.");
// If there's a problem with the content of your message,
// the API will still return, but with an error status code,
// you should take appropriate steps to resolve/retry if this
// happens.
if (sendResult.Status == PostmarkStatus.Success){ /* Handle success */ }
else { /* Resolve issue.*/ }
}catch{
// Calls to the client can throw an exception
// if the request to the API times out.
}
}
This is the bare-minimum to send an email using the Postmark client, but you can do a great deal more with with the Postmark.Net library. Take special note that you should replace <server token>
with the token you obtained in item two of the pre-requisites, and replace <sender signature>
with the signature you obtained from item three of the pre-requisites above.
Next, check out more advanced sending options on our Sending Email wiki page, and the other topics listed in the sidebar on the right of this wiki.
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