PHP code example of facteur-dev / facteur-php

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

    

facteur-dev / facteur-php example snippets


use FacteurDev\FacteurPhp\Facteur;

$facteur = new Facteur('<your-api-key>');
try {
    $facteur->sendEmail([
        'from' => '[email protected]',
        'to' => '[email protected]',
        'subject' => 'Hello, World!',
        'text' => 'it works!',
        'html' => "<h1>it <u>works</u>!</h1>"
    ]);
} catch (Exception $e) {
    echo $e->getMessage();
}
bash
composer