Skip to content


Subversion checkout URL

You can clone with
Download ZIP
For anybody who wants to use Postmark via API with Swiftmailer, including but not limited to anybody who wants to send mail with Symfony in the normal way that is documented in all of the Symfony HOWTOs etc. Written by Tom Boutell of P'unk Avenue. Swiftmailer core credit
Latest commit 42fdbf2 Alex Hillman initial commit
Failed to load latest commit information.
lib initial commit


A Symfony-Compatible Swiftmailer backend for Postmark (


Any Swiftmailer fan can use this to deliver email, you don't absolutely need to be using Symfony. You could use it with Symfony 2.0 as well, but here's how we use it with Symfony 1.4.

Configure factories.yml to use Postmark when you use Swiftmailer in a normal fashion, like this:

    delivery_strategy: realtime
      class: sfPostmarkSwiftmailer
        # NOTE: must also be updated in app.yml
        postmarkApiToken: 'GET-YOUR-OWN'
        from: ''
        # postmarkUri could be overridden if necessary

Both the original class and the sfPostmarkSwiftmailer subclass are released under the BSD open source license.


The Postmark mailer assumes that the "main" body of the message (setBody()) is the plaintext version. Just make sure that is the case and use setBody() for the plaintext and addPart() for the HTML (if any):

$message->setBody($text, 'text/plain');
$message->addPart($html, 'text/html');


The Swift_PostmarkTransport class found in the lib/postmark-swiftmailer file is originally by "oystein," as found here:

The original author did not choose to give much information but did select the BSD open source license.

Since that code has not been updated in a long time, there is one modification by P'unk Avenue found here that is not included there. It is a fix for a problem with setting the Postmark "from address" signature:

The subclass sfPostmarkSwiftmailer, found in the main lib/ folder, was written by Tom Boutell of P'unk Avenue ( It adds full Symfony compatibility by implementing dependency injection methods allowing the mailer to be configured via factories.yml. We did this work to help build Apostrophe:


Both the original postmark_swiftmailer code and the sfPostmarkSwiftmailer subclass are released under the BSD license.
Something went wrong with that request. Please try again.