The Laravel Postmark Provider is no longer being actively updated. The following is a short discussion on the reasoning for discontinuing the provider. However, it's still really easy to still use Postmark in Laravel using SMTP, and since the SMTP provider is part of Laravel, it'll keep working when you update Laravel and you won't need to install any dependencies to use it.
Here's everything you'll need:
config/mail.php
file to include the following:<?php
return [
'username' => env('<YOUR_POSTMARK_SERVER_TOKEN>'),
'password' => env('<YOUR_POSTMARK_SERVER_TOKEN>'),
'host' => env('MAIL_HOST', 'smtp.postmarkapp.com'),
// Optionally, set "smtp" to "log" if you want to trap emails during testing.
'driver' => env('MAIL_DRIVER', 'smtp'),
'port' => env('MAIL_PORT', 587),
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails sent by your application to be sent from
| the same address. Here, you may specify a name and address that is
| used globally for all e-mails that are sent by your application.
|
| It is also OK to not set this from address here and specify it on each message.
|
| Remember, when using Postmark, the sending address must be a valid
| Sender Signature that you have already configured.
*/
'from' => ['address' => null, 'name' => null],
];
We provide an official PHP library that can be installed via composer to do more advanced Postmark integrations. If you want to move beyond basic email sending, Postmark-PHP will give you easy access to all Postmark API endpoints.
The Postmark Laravel Provider was built and will work with versions of Laravel up to 5.2, if you'd still like to use it, please feel free to follow the instructions below.
composer require wildbit/laravel-postmark-provider
.env
file:POSTMARK_TOKEN=<YOUR_SERVER_TOKEN>
config/services.php
file (it will use the token in your .env
from Step 2):'postmark' => env('POSTMARK_TOKEN'),
config/app.php
file:Find this line:
'Illuminate\Mail\MailServiceProvider',
And replace it with:
'Postmark\Adapters\LaravelMailProvider',
That's it! You've integrated Postmark into your Laravel Application.