PHP code example of xiaohuilam / laravel-submail

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

    

xiaohuilam / laravel-submail example snippets


'providers' => [
    Bingooo\Mail\SubMailServiceProvider::class,
];

Mail::send('emails.welcome', $data, function ($message) {
    $message->from('[email protected]', 'XXXXX');
    $message->to('[email protected]')->cc('[email protected]');
});

$vars = ['name' => 'hi','link_text' => 'http://example.com'];
$links = ['link' => 'http://example.com'];
$template = new Bingooo\Mail\SubMailTemplate('XXXXX', $vars, $links);
\Mail::raw($template,function($message){
  $message->from('[email protected]', 'XXXXX');
  $message->to('[email protected]');
});
ini
MAIL_DRIVER=submail

SUBMAIL_APPID=
SUBMAIL_APPKEY=