PHP code example of hyperdigital / raw-email

1. Go to this page and download the library: Download hyperdigital/raw-email 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/ */

    

hyperdigital / raw-email example snippets




use Hyperdigital\RawEmail\RawEmail;

$html = "<h1>HTML version</h1>";
$rawEmail = new RawEmail("[email protected]", "[email protected]");
$rawData = $rawEmail->build(array('[email protected]'), 'Some subject', 'Plain text version', $html);

// Send the email data



use Aws\Common\Aws;
use Hyperdigital\RawEmail\RawEmail;

$html = "<h1>HTML version</h1>";
$rawEmail = new RawEmail("[email protected]", "[email protected]");
$rawData = $rawEmail->build(array('[email protected]'), 'Some subject', 'Plain text version', $html);

$aws = Aws::factory($credentials);
$ses = $aws->get('Ses');

$ses->sendRawEmail(array(
    'RawMessage' => array(
        'Data' => base64_encode($rawData),
        ),
    )
);

bash
composer