PHP code example of datascaled / laravel-m365-mailer

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

    

datascaled / laravel-m365-mailer example snippets


'mailers' => [
    // ...
    'm365' => [
        'transport' => 'm365',
        'tenant_id' => env('M365_TENANT_ID'),
        'client_id' => env('M365_CLIENT_ID'),
        'client_secret' => env('M365_CLIENT_SECRET'),
        'timeout' => env('M365_MAIL_TIMEOUT', 15),
    ],
],

Mail::mailer('m365')->to('[email protected]')->send(new WelcomeMail());
bash
php artisan vendor:publish --tag="m365-mailer-config"
php artisan vendor:publish --tag="m365-mailer-migrations"
php artisan migrate
bash
php artisan m365-mail:prune
bash
php artisan m365-mail:prune --days=14