-
Notifications
You must be signed in to change notification settings - Fork 48
Using the Bounce API
The Postmark Bounce API is a useful tool for finding which emails bounced because of impossibly delivery. There are a variety of bounce types, all of which are available to sort with using the Postmark library.
PostmarkClient client = new PostmarkClient("YOUR_API_KEY");
var bounces = client.GetBounces(true, "[email protected]", 0, 100);
Searches for any bounces that are inactive (the email addresses are inactive on the Postmark system) to [email protected] while skipping none and limiting the list to 100.
Bounces are automatically deserialized into PostmarkBounce objects which, in JSON, look like:
{
"ID": [ID],
"Type": "HardBounce",
"MessageID" : "d12c2f1c-60f3-4258-b163-d17052546ae4",
"TypeCode" : 1,
"Details": "test bounce",
"Email": "[email protected]",
"BouncedAt": "[YESTERDAY]",
"DumpAvailable": true,
"Inactive": true,
"CanActivate": true,
"Content" : "Return-Path:....",
"Subject" : "Hello from our app!"
}
In order to retrieve the full dump of a bounce, you may use the client.GetBounceDump(ID)
call and using the ID retrieved from the list of Bounces from the GetBounces()
call.
client.GetBounceTags()
will retrieve a list of tags that have been used for sending messages over the history of the server you're querying (by API key).
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