PHP code example of sitegeist / neos-symfonymailer-factories

1. Go to this page and download the library: Download sitegeist/neos-symfonymailer-factories 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/ */

    

sitegeist / neos-symfonymailer-factories example snippets


use Sitegeist\Neos\SymfonyMailer\Factories\MailerFactory;
use Sitegeist\Neos\SymfonyMailer\Factories\MailFactor;

class MailController
{
    #[Flow\Inject]
    protected MailerFactory $mailerFactory;

    #[Flow\Inject]
    protected MailFactory $mailFactory;

    public function exampleAction()
    {
        $mailer = $this->mailerFactory->createMailer();
        $mail = $this->mailFactory->createMail(
            $subject,
            $recipient,
            $sender,
            $text,
            $html
        );
        $mailer->send($mail);
    }