Set up DMARC and see who's sending email using your brand's domain.
x

Send emails with PHP

With over a dozen libraries, Postmark API is a great fit for sending emails in any PHP project

5 Minute Set Up

1

Install the Postmark PHP library with composer from the command line:

composer require wildbit/postmark-php
2

Create an instance of PostmarkClient and send your first email.

<?php

// Import the Postmark Client Class:
require_once('./vendor/autoload.php');
use Postmark\PostmarkClient;

$client = new PostmarkClient("POSTMARK-SERVER-API-TOKEN-HERE");

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

?>

Want to test our APIs and activity logging? Send emails to test@blackhole.postmarkapp.com

3

Once you’ve sent your first email, check out the PHP library docs →

Official Library

The official Postmark PHP library is available as a Composer package on Packagist.org.

Community Libraries

Here’s what our customers think of us

Postmark has a reputation for high quality. Even though there are several good companies, we were convinced by Postmark’s clear documentation and transparent roadmap. Further, building email infrastructure is really a partnership — we wanted to invest in a platform that would continue to grow along with our needs, not one that was fairly static and falling behind the technology curve.

Cliff Chang

Cliff Chang

Product Engineer at Asana

I was shocked to see Postmark open rates were an 11% improvement over SES in our test. Needless to say we started sending all of our transactional email through Postmark.

Dave Marshall

Dave Marshall

CTO at Childcare.co.uk

We’re really happy we decided to use Postmark for ITV’s British Soap Awards. We only count votes from verified email addresses and Postmark’s excellent delivery has lead to our highest verification percentage ever. We'll definitely use Postmark again!

Owen Matthews

Owen Matthews

Creative Director at Ten4 Design

Postmark blows every other transactional email product out of the water.

Kyle Racki

Kyle Racki

CEO at Proposify

From side projects to Fortune 500...

We’ve got you covered. We process transactional email for companies of all sizes:

Everything you need for first class email delivery

A comprehensive suite of tools to help you seamlessly integrate email with your PHP application.

  • Stack of emails

    45 days worth of full content history by default to help you troubleshoot (customizable from 7 to 365 days if needed).

  • Placeholder

    Easy integration via API or SMTP so you can start sending in minutes.

  • Placeholder

    Increased visibility with detailed open and delivery tracking for every email.

  • Placeholder

    Keep track of bounced emails through the web dashboard, or use web hooks to notify your app of any issues.

  • Placeholder

    Take the pain out of handling inbound email. Postmark turns inbound email into a handy JSON object and posts it to a web hook URL.

  • Envelope stamped "DKIM"

    SPF, DKIM, and DMARC support included, with clear guides to help you get set up.

Lightning fast delivery

Your customers expect transactional emails to arrive immediately—not eventually.
We constantly monitor our delivery speeds and share the data publicly.

  • Gmail

  • Apple

  • Hotmail

  • AOL

  • Yahoo

Time to Inbox data updated every 5 minutes

Ready to get started?

Join thousands of developers that already trust their email delivery to Postmark.