Free Webinar: Using Postmark to send effective emails Learn how to improve the effectiveness of your transactional emails
x

A powerful email API for applications that rely on email.

Every API endpoint is specifically designed to make it easier to send great transactional email.

Start sending with Postmark’s email API in minutes.

Robust client libraries allow you to integrate with our email API in minutes. Choose from libraries for all popular languages including: PHP, Node.js, .Net, Ruby, Java, and more.

Simpler applications can use our reliable SMTP service. Making it possible to unlock Postmark’s exceptional email delivery in seconds.


// Send an email with the Postmark-PHP library
// Learn more -> https://postmarkapp.com/developer/integration/official-libraries#php

// Install with composer
composer require wildbit/postmark-php

// Import
use Postmark\PostmarkClient;

// Example request
$client = new PostmarkClient("server token");

$sendResult = $client->sendEmail(
  "sender@example.com",
  "receiver@example.com",
  "Hello from Postmark!",
  "This is just a friendly 'hello' from your friends at Postmark."
);

# Send an email with the Postmark Ruby Gem
# Learn more -> https://postmarkapp.com/developer/integration/official-libraries#ruby-gem

# Install with Bundler
gem 'postmark'

# Create an instance of Postmark::ApiClient
client = Postmark::ApiClient.new('POSTMARK_API_TEST')

# Example request
client.deliver(
  from: 'sender@example.com',
  to: 'receiver@example.com',
  subject: 'Hello from Postmark',
  html_body: '<strong>Hello</strong> dear Postmark user.',
  track_opens: true
)

# Send an email with the Postmark Rails Gem
# Learn more -> https://postmarkapp.com/developer/integration/official-libraries#rails-gem

# Add this to your gemfile
gem 'postmark-rails'

# Add this to your config/application.rb file:
config.action_mailer.delivery_method = :postmark
config.action_mailer.postmark_settings = { :api_token => "POSTMARK_API_TEST" }

# Send the email
class TestMailer < ActionMailer::Base
  def message
    mail(
      :subject => 'Hello from Postmark',
      :to  => 'receiver@example.com',
      :from => 'sender@example.com',
      :html_body => '<strong>Hello</strong> dear Postmark user.',
      :track_opens => 'true'
    )
  end
end

// 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);
}

// Send an email with the Postmark.js library
// Learn more -> https://postmarkapp.com/developer/integration/official-libraries#node-js

// Install with npm
npm install postmark --save

// Require
var postmark = require("postmark");

// Example request
var client = new postmark.Client("server token");

client.sendEmail({
    "From": "sender@example.com",
    "To": "receiver@example.com",
    "Subject": "Test",
    "TextBody": "Hello from Postmark!"
});

# Send an email with curl
# Copy and paste this into terminal

curl "https://api.postmarkapp.com/email" \
  -X POST \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -H "X-Postmark-Server-Token: POSTMARK_API_TEST" \
  -d "{From: 'sender@example.com', To: 'receiver@example.com', Subject: 'Hello from Postmark', HtmlBody: '<strong>Hello</strong> dear Postmark user.'}"

Postmark has been a breeze to integrate with our Rails app using the ruby gem. That’s a nice change from hand-coding an API client which I’ve had to do with other services.

Use Postmark servers to manage sending for different apps or environments.

Postmark allows you to organize your transactional email into logical groups called servers. Each server can represent a different application or environment. That way you have focused reports, limited access API keys, and a simple way of managing project-level user permissions.

Screenshot of servers page in the Postmark app

We’re right on the edge of what people are doing with email, and the Postmark team has been incredibly responsive at helping us, or even building new functionality to meet our needs. This makes it really feel like Postmark is an extension of our team…

Send email on behalf of your customers without spoofing.

Adding DNS entries can be tedious and even a little confusing at times. Postmark guides you through setting up records to protect your domain reputation, giving your emails the best possible chance at inbox placement.

You can even integrate DKIM, SPF, and DMARC support for your customers’ domains using our API.

Screenshot of the Sender Signatures page in the Postmark app

Developer friendly API documentation.

Unlock the full potential of your application-driven emails with our clear API documentation.

Use the API Explorer to test drive API calls against your account and get responses with real data.

Screenshot of the Postmark API documentation

Switching from another email provider?

Our migration guides have got you covered. We’ve done the legwork to make switching to Postmark as smooth as possible.

It was incredibly easy to setup Postmark. In under 10 minutes I had the first test working and rolling it out to production was just as easy.

Use webhooks to notify your application of key message events.

Notify your application every time an email is delivered, opened, bounces, or a link is clicked. Email shouldn't be a fire-and-forget communication channel. Make email a first-class citizen with Postmark’s modular webhooks.

Two servers with arrows between indicating bounce and open tracking

Manage your email templates in one place.

Build and manage your application’s email templates from the Postmark app. Once you’re done, use our email API to send personalized emails to your customers.

Screenshot of the Postmark Templates page

Auto-detect bounces and prompt customers to update their email.

Use Postmark Rebound to notify customers inside your app when an email you sent them bounced. Rebound automatically hooks up to our API so you don’t have to write any custom code.

Screenshot of the Sender Signatures page in the Postmark app

Do more than just send email with the Postmark API.

The Postmark API allows you to manage servers, domains, sender signatures, templates, and retrieve stats so you can fully automate your email infrastructure.

Read the API docs

Incorporate Postmark status into your dashboard with our Status API.

Postmark’s Status API allows you to track our status in your own application or dashboard. We even have a Slack app so you can check our status while still communicating with your team.

{
    "status": "UP",
    "lastCheckDate": "2016-03-17T14:50:24+00:00"
}

Still have questions?

  • Ashley Harpp Ashley
  • Dana Chaby Dana

Ask us anything! We’re eager to help you with any problem or question you have…