PHP code example of resent / symfony-mailer

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

    

resent / symfony-mailer example snippets


use Resent\SymfonyMailer\Transport\ResentTransport;
use Symfony\Component\Mailer\Mailer;
use Symfony\Component\Mime\Email;

$transport = new ResentTransport(getenv('RESENT_API_KEY'));
$mailer = new Mailer($transport);

$email = (new Email())
    ->from('Acme <[email protected]>')
    ->to('[email protected]')
    ->subject('Hello World')
    ->html('<strong>It works!</strong>');

$mailer->send($email);