composer require bogardo/mailgun
composer require php-http/guzzle6-adapter
MAIL_DRIVER=mailgun
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=587
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS=something@domain.com
MAIL_FROM_NAME=Project
Bogardo\Mailgun\MailgunServiceProvider::class
'Mailgun' => Bogardo\Mailgun\Facades\Mailgun::class
$this->app->bind('mailgun.client', function() {
return \Http\Adapter\Guzzle6\Client::createWithConfig([]);
});
'domain' => 'domain.com',
'secret' => 'key-*yourapikey*'
php artisan vendor:publish --provider="Bogardo\Mailgun\MailgunServiceProvider" --tag="config"
$response = \Mailgun::send('emails.myview', [], function ($message) {
$message->to('send@someone.com', 'Someones Name')->subject('My Subject!');
});
$response = \Mailgun::later(60, 'emails.myview', [], function ($message) {
$message->to('send@someone.com', 'Someones Name')->subject('My Subject!');
});
'api' => [
'endpoint' => 'bin.mailgun.net',
'version' => 'yourID',
'ssl' => true
],