1. Go to this page and download the library: Download lettermint/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/ */
lettermint / symfony-mailer example snippets
use Symfony\Component\Mailer\MailerInterface;
use Symfony\Component\Mime\Email;
function sendReceipt(MailerInterface $mailer): void
{
$email = (new Email())
->from('Example <[email protected]>')
->to('[email protected]')
->subject('Your receipt')
->text('Thank you for your order.')
->html('<p>Thank you for your order.</p>');
$mailer->send($email);
}
use Lettermint\SymfonyMailer\Transport\LettermintTransportFactory;
use Symfony\Component\Mailer\Mailer;
use Symfony\Component\Mailer\Transport;
$registry = new Transport([new LettermintTransportFactory()]);
$transport = $registry->fromString('lettermint+api://'.rawurlencode($projectToken).'@default');
$mailer = new Mailer($transport);
$mailer->send($email);