Quest to send email from PHP

Singapore PHP User Group Meetup - May 2016

Kai Hendry

The problem

How to best send "transactional" emails from a PHP application?

Once upon a time, things were simple

But were they?

Then things got REAL

Third party services

How do we integrate?

SMTP or... Web services?

Now how do we make PHP non-blocking whilst sending an email?

My current solution

SMTP is > 3s

# php index.php
    [MessageId] => 01010154b8cc7867-26380800-a956-46a6-8066-8d1212237673-000000
    [RequestId] => c69fb51a-1b44-11e6-9e96-b13478510368

Wish: this could be integrated into mail()

And on the browser!

fetch("", { method: "POST", body: formData }).then(function (res) {
    if (res.ok) {
    } else {
        console.log("error", res);

AWS SES setup

How to action on the data?

Thank you