PHP code example of zfr / zfr-mail

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

    

zfr / zfr-mail example snippets


$mail = (new RenderedMail())->withFrom('[email protected]')
    ->withTo('[email protected]')
    ->withSubject('Hello')
    ->withTextBody('This is a mail')
    ->withHtmlBody('<p>This is a mail</p>');

$mail = (new TemplatedMail())->withFrom('[email protected]')
    ->withTo('[email protected]')
    ->withTemplate('templ-1234')
    ->withTemplateVariables(['first_name' => 'Foo']);

return [
    'zfr_mail' => [
        'postmark' => [
            'server_token' => 'YOUR_SERVER_TOKEN'
        ]
    ],
];

return [
    'aws' => [
        'credentials' => [
            'key' => 'YOUR_AWS_KEY',
            'secret' => 'YOUR_AWS_SECRET'
        ],
        'region' => 'YOUR_AWS_REGION',
        'version' => 'AWS_VERSION' // most of the time 'latest'
    ],
];

$mailer->send($mail);

$messageId = $mailer->send($mail);
sh
php composer.phar 
ssh
php composer.phar quire 'aws/aws-sdk-php:^3.36'