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

Use Postmark to Send Emails from Craft CMS

This tutorial will show you how to configure Craft to send emails through Postmark using the Postmark mail adapter or SMTP.

If you are using a new Postmark account, first you will need to set up a server and Sender Signature in your Postmark account. Please follow this walkthrough on setting these up. Once these steps are completed, you can continue using this tutorial to send through Postmark with your Craft instance.

Configure Postmark Using Our Mail Adapter (recommended)

Start by installing the Postmark mail adapter through the Craft plugin store or by running the following commands from your project's root folder.

# Require the Postmark mail adapter
composer require craftcms/postmark

# Install the plugin
./craft install/plugin postmark

Configure Craft’s Email Settings to Use The Mail Adapter

  1. Log into your Craft admin area and click Settings, then click Email. This will show you your current email settings for your Craft instance.
  2. Change the Transport Type to Postmark. Also, ensure that your System Email Address in your Craft Email Settings matches your confirmed Sender Signature email address in Postmark.
  3. Enter your Server Token (which you can get from your server page under “API Tokens”).
  4. Optional - If you wish to send email using a custom Message Stream, set the Message Stream ID. (The default transactional Message Stream will be used if this is left blank.)
  5. Then click Test to generate a Test email from Craft. You will see a modal confirming the test went through successfully or receive an error.
  6. Be sure to save your email settings at the top before leaving your Craft settings.

Confirm

Emails sent from Craft should now appear in the Activity area for the server you set up to use with Craft, including the test email you just generated.

Emails sent from Craft will now be going through Postmark using the official Postmark mail adapter. Send some emails from Craft to an inbox you can access to confirm it is working.

Configure Postmark using SMTP

Before accessing your Craft settings, ensure that SMTP is enabled on your Postmark stream you intend to send from. Open your server you set up in Postmark. Then the message stream you’re looking to receive the SMTP settings from. The select Settings. Enable SMTP for the stream..

Enable SMTP for the server

Configure Craft’s Email Settings to Use SMTP

  1. Log into your Craft admin area and click Settings, then click Email. This will show you your current email settings for your Craft instance.
  2. Change the Transport Type to SMTP. This will tell Craft to send emails using SMTP. Also, ensure that your System Email Address in your Craft Email Settings matches your confirmed Sender Signature email address in Postmark.
  3. For Host Name, use smtp.postmarkapp.com and check ‘Use SMTP authentication’. Next, change the SMTP Secure Transport Type to TLS.
  4. Head over to Postmark and access your Server API Token. This can be accessed from your server you set up previously in the API Tokens area. Copy this token.Return to your tab with your Craft email settings. Enter in your Server API Token we just copied for both Username and Password
  5. Then click Test to generate a Test email from Craft. You will see a modal confirming the test went through successfully or receive an error.
  6. Tip: If your test email results in an error, try using ports 587 or 2525, instead of port 25. Some ISPs or hosts will block port 25, so you may need to use 587 or 2525.
  7. Be sure to save your email settings at the top before leaving your Craft settings.

Confirm

Emails sent from Craft should now appear in the Activity area for the server you set up to use with Craft, including the test email you just generated.

Emails sent from Craft will now be going through Postmark using SMTP. Send some emails from Craft to an inbox you can access to confirm it is working.

Last updated February 15th, 2021

Still need some help?

Our customer success team has your back!