PHP code example of avn / symfony-send-email

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

    

avn / symfony-send-email example snippets


class SomeController extends AbstractController
{
    public function index(
        SendEmailAction $sendEmailAction 
    ) {
        $sendEmailAction->execute(
            new SendEmailRequest(
                '[email protected]', //to
                'Greetings!', //subject
                'Hello, it`s me!' // textContent
                '<p>Hello, it`s me!</p>' //htmlContent
            )        
        );
    }
}