PHP code example of maize-tech / laravel-msgraph-mailer
1. Go to this page and download the library: Download maize-tech/laravel-msgraph-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/ */
maize-tech / laravel-msgraph-mailer example snippets
use Illuminate\Support\Facades\Mail;
Mail::raw('Hello from Microsoft Graph!', function ($message) {
$message->to('[email protected]')
->subject('Test Email');
});
use Illuminate\Support\Facades\Mail;
use App\Mail\WelcomeEmail;
Mail::to('[email protected]')->send(new WelcomeEmail($user));
use Illuminate\Support\Facades\Mail;
Mail::send('emails.welcome', ['user' => $user], function ($message) use ($user) {
$message->to($user->email)
->subject('Welcome!')
->attach('/path/to/file.pdf');
});