a transport (SMTP, PHP Mail, Sendmail, Mailgun, Mandrill, Log) $transport = Swift_SmtpTransport::newInstance(getenv('SMTP_HOST'), getenv('SMTP_PORT')); // $transport = Swift_MailTransport::newInstance(); // $transport = Swift_SendmailTransport::newInstance('/usr/sbin/sendmail -bs'); // $transport = new MailgunTransport(getenv('MAILGUN_SECRET'), getenv('MAILGUN_DOMAIN')); // $transport = new MandrillTransport(getenv('MANDRILL_SECRET')); // $transport = new SesTransport(new SesClient($sesConfig)); // $transport = new LogTransport($logger->getMonolog()); // SMTP specific configuration $transport->setUsername(getenv('SMTP_USERNAME')); $transport->setPassword(getenv('SMTP_PASSWORD')); $transport->setEncryption(true); $swift = new Swift_Mailer($transport); $finder = new FileViewFinder(new Filesystem, ['views']); $resolver = new EngineResolver; // Determine which template engine to use $resolver->register('php', function () { return new PhpEngine; }); $view = new Factory($resolver, $finder, new Dispatcher); $mailer = new Mailer($view, $swift); // Optionally set logger, queue manager, and container Mail: prepare