Sending SMTP Mails with SilverStripe 4

Since SilverStripe 4 uses Switf Mailer for sending emails, you can easily activate SMTP support for it.

First create a usable Swift_SmtpTransport object which contains all required smtp settings:


class MySmtpMailTransport extends Swift_SmtpTransport {

     function __construct() {
        parent::__construct('smtp.server.local', 465, 'ssl');


In the next step register this class in your config.yml for the Injector:

Name: myemailconfig
After: emailconfig
  Swift_Transport: MySmtpMailTransport

SilverStripe sends now emails via SMTP.