PHP code example of idci / aws-ses-bundle
1. Go to this page and download the library: Download idci/aws-ses-bundle library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
idci / aws-ses-bundle example snippets
// app/AppKernel.php
public function registerBundles()
{
$bundles = array(
// ...
new IDCI\Bundle\AwsSesBundle\AwsSesBundle(),
);
}
use SimpleEmailServiceMessage;
$mailer = $this->getContainer()->get('aws_ses');
$message = new SimpleEmailServiceMessage();
$message
->setFrom('[email protected]')
->addTo('[email protected]')
->setSubject('Hello, world!')
->setMessageFromString('This is the message body.')
;
print_r($mailer->sendEmail($message));
// Successful response should print something similar to:
// Array(
// [MessageId] => 0000012dc5e4b4c0-b2c566ad-dcd0-4d23-bea5-f40da774033c-000000
// [RequestId] => 4953a96e-29d4-11e0-8907-21df9ed6ffe3
// )