PHP code example of puz / dynamic-mail

1. Go to this page and download the library: Download puz/dynamic-mail 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/ */

    

puz / dynamic-mail example snippets



// ...
return [
    // ...
    'aliases' => [
        // ...
        // Overwrite Laravel mailer
        'Mail' => Puz\DynamicMail\Facades\DynamicMail::class,
        // Own mailer
        'DynamicMail' => Puz\DynamicMail\Facades\DynamicMail::class,
    ]
];


// 1
Mail::with(['domain' => 'another.domain.tld'])->to('..')->send('..');

// 2
Mail::via('mailgun')->to('..')->send('..');

// 3
Mail::via('mailgun')->with(['domain' => 'hello.tld', 'secret' => 'https://www.youtube.com/watch?v=Iz-8CSa9xj8'])->to('..')->send('..');