PHP code example of sainisch-sczepanski-streller / laravel-graph-api-mail-driver
1. Go to this page and download the library: Download sainisch-sczepanski-streller/laravel-graph-api-mail-driver 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/ */
sainisch-sczepanski-streller / laravel-graph-api-mail-driver example snippets
composer
MAIL_FROM_ADDRESS=<your sender address>
MAIL_MAILER=microsoft-graph-api
MAIL_MS_GRAPH_CLIENT_ID=<your client id>
MAIL_MS_GRAPH_CLIENT_SECRET=<your client secret>
MAIL_MS_GRAPH_TENANT_ID=<your tenant id>
MAIL_MS_GRAPH_SAVE_TO_SENT_ITEMS=<bool>
'mailers' => [
'microsoft-graph-api' => [
'transport' => 'microsoft-graph-api',
'client_id' => env('MAIL_MS_GRAPH_CLIENT_ID'),
'client_secret' => env('MAIL_MS_GRAPH_CLIENT_SECRET'),
'tenant_id' => env('MAIL_MS_GRAPH_TENANT_ID'),
'saveToSentItems' => env('MAIL_MS_GRAPH_SAVE_TO_SENT_ITEMS', true),
],
...
Mail::to([<recipients>])->send(<your mail class>);