PHP code example of graph-mail / laravel-graph-mail-legacy

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

    

graph-mail / laravel-graph-mail-legacy example snippets


'mailers' => [
    // ...your other mailers
    'graph' => [
        'transport' => 'graph',
    ],
],

'driver' => 'graph',

Mail::to('[email protected]')->send(new InvoiceMailable($invoice));

Mail::to('[email protected]')->queue(new WelcomeMailable($user));

Mail::raw('Plain text body', function ($message) {
    $message->to('[email protected]')->subject('Quick note');
});

Mail::raw('Billing question follow-up', function ($message) {
    $message->to('[email protected]')->subject('Re: Invoice #1234');
});
// Sent as MS_SENDER_EMAIL, regardless of any ->from() call.

Mail::raw('See attached report', function ($message) {
    $message->to('[email protected]')
        ->subject('Monthly Report')
        ->attach(storage_path('app/reports/october.pdf'));
});
bash
php artisan graph-mail:test [email protected]
bash
php artisan tinker
>>> dump(config('graph-mail.default_sender'));
>>> dump(strlen(config('graph-mail.default_sender')));