PHP code example of nasimail / laravel-client

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

    

nasimail / laravel-client example snippets


'mailers' => [
  // ...
  'nasimail' => [
    'transport' => 'nasimail',
    'base_url' => env('NASIMAIL_BASE_URL'),
    'secret_key' => env('NASIMAIL_SECRET_KEY'),
    'timeout' => env('NASIMAIL_TIMEOUT', 10),
  ],
],

use NasiMail\Laravel\NasiMailClient;

$response = app(NasiMailClient::class)->send([
    'from' => '[email protected]',
    'to' => ['[email protected]'],
    'subject' => 'Hello',
    'text' => 'Hi there',
]);
bash
php artisan vendor:publish --tag=nasimail-client-config
bash
php artisan config:clear
php artisan cache:clear