PHP code example of morenorafael / laravel-mail

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

    

morenorafael / laravel-mail example snippets


...

'sendgrid' => [
    'key' => env('SENDGRID_KEY'),
],

...

...

'sendgrid' => [
    'transport' => 'sendgrid',
],

...

...

'sendinblue' => [
    'key' => env('SENDINBLUE_KEY'),
],

...

...

'sendpulse' => [
    'transport' => 'sendpulse',
],
...

$user = new \App\Models\User([
    'email' => '[email protected]',
    'name' => 'Your Name'
]);

\Illuminate\Support\Facades\Mail::send('mails.welcome', [
    'email' => $user->email,
    'name' => $user->name,
], function ($mail) use ($user) {
    $mail->to($user->email, $user->name)->subject('Test');
});