Send emails through AWS SES from console using SwiftMailer

Table of Content

Testing Email Sending Using the Command Line

Verifying a Domain With Amazon SES

Setting Up Easy DKIM for a Domain

Can I use Amazon’s SES with Symfony2 and the Swiftmailer Bundle?

Swiftmailer Spooling and Handling Failures

Problems with Emails Received from Amazon SES

Final script for check email sending

require __DIR__ . '/vendor/autoload.php';

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Debug\Debug;


$loader = require __DIR__ . '/app/autoload.php';

// Run bootstrap
$kernel = new AppKernel('prod', true);
$request = Request::createFromGlobals();

$container = $kernel->getContainer();
$container->set('request', $request);

/** @var $mailer \Swift_Mailer */
$mailer = $container->get('mailer');

$transport = \Swift_SmtpTransport::newInstance('', 587, 'tls')

// Create a message
$message = Swift_Message::newInstance($transport)
    ->setSubject('Amazon SES SMTP Test')
    ->setBody('This message was sent using the Amazon SES SMTP interface.');

// Send the message
$result = $mailer->send($message);

Run the script

php send-email.php

Leave a Reply

Your email address will not be published. Required fields are marked *