Skip to content

SMTP

This document outlines how to configure outgoing email for your application.

How it works

AWS SES

Our solution is built on top of AWS SES which provides a reliable, scalable, and secure solution for email delivery.

skprmail

Skpr has a drop-in solution for sendmail called skprmail.

Our PHP images are configured to use this solution out of the box. Resulting in minimal, to no configuration required.

Requirements

Set the FROM address

AWS SES requires a validated FROM address to ensure ownership.

This is set in the project's configuration file.

cat .skpr/defaults.yml

...

smtp:
  from:
    address: admin@example.com

But you're not done yet. You also need to validate the domain for the FROM address.

From Address Validation (DKIM)

Next, you will need to collaborate with the Skpr Platform team who will take you through the process of getting your domain DKIM validated.

This will require several DNS entries to be created.

Once complete, email will be allowed to be sent from your application.

Debug

The steps below outline how to test that the platform is configured correctly.

These instructions are inspired by our README.md.

1. Start a shell session

skpr shell ENVIRONMENT

2. Create an email

cat /mnt/local/email.txt

To: YOUR_EMAIL_GOES_HERE
Subject: sendmail test two
From: me@myserver.com

And here goes the e-mail body, test test test.

Notice we picked the /mnt/local filesystem. This is a temporary local filesystem that is writable.

All files in this directory will be deleted after your shell session is closed.

Also, note that YOUR_EMAIL_GOES_HERE needs to be updated.

3. Send a test email

The command below opens the file and sends it to our mail program.

cat /mnt/local/email.txt | skprmail

4. Check your inbox

Check the inbox of the email address that you set YOUR_EMAIL_GOES_HERE to.

5. Didn't work?

The Skpr platform team is more than happy to help you out.

Reach out to us in Slack and we will help you debug it.

Local Development

Our mail setup can also be used for local development.

By default our skprmail program will send emails to the host:

mail:1025

These emails can be captured with the example Docker Compose configuration below:

mail:
  image: mailhog/mailhog
  ports:
    # Port to access the mailhog user interface.
    - 8025:8025