PHP code example of mailvoidr / laravel

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

    

mailvoidr / laravel example snippets


'mailvoidr' => [
    'transport' => 'mailvoidr',
],

use Illuminate\Support\Facades\Mail;
use App\Mail\WelcomeMail;

Mail::to('[email protected]')->send(new WelcomeMail());

// Notification
$user->notify(new OrderShipped($order));

return $this->from('[email protected]', 'Acme')
    ->subject('Welcome')
    ->view('emails.welcome');

use Mailvoidr\Laravel\Facades\Mailvoidr;

$response = Mailvoidr::send([
    'to' => ['[email protected]'],
    'subject' => 'Welcome to Acme',
    'html' => '<h1>Hey Riya</h1>',
]);

$send = Mailvoidr::getSend($response->id);

use Mailvoidr\Laravel\Client\MailvoidrClient;

public function __construct(private MailvoidrClient $mailvoidr) {}