PHP code example of drewlabs / envoyer-aws

1. Go to this page and download the library: Download drewlabs/envoyer-aws 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/ */

    

drewlabs / envoyer-aws example snippets


use Drewlabs\Envoyer\Drivers\Aws\SESAdapter;
use Drewlabs\Envoyer\Drivers\Aws\Utils\CredentialsFactory;
use Drewlabs\Envoyer\Mail;

$config = reate mail adapter
$adapter = SESAdapter::new([
    'region' => $config['region'],
    // Creates a promise object for aws credentials
    'credentials' => CredentialsFactory::create($config['user'], $config['password'])
]);

// Send mail request
$result = $adapter->sendRequest($mail);