06.10.2016 Views

laravel-5

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Mail<br />

• Introduction<br />

• Sending Mail A> - Attachments A> - Inline Attachments A> - Queueing Mail<br />

• Mail & Local Development<br />

• Events<br />

Introduction<br />

Laravel provides a clean, simple API over the popular SwiftMailer¹⁸⁹ library. Laravel provides drivers<br />

for SMTP, Mailgun, Mandrill, SparkPost, Amazon SES, PHP’s mail function, and sendmail, allowing<br />

you to quickly get started sending mail through a local or cloud based service of your choice.<br />

Driver Prerequisites<br />

The API based drivers such as Mailgun and Mandrill are often simpler and faster than SMTP servers.<br />

All of the API drivers require that the Guzzle HTTP library be installed for your application. You<br />

may install Guzzle to your project by adding the following line to your composer.json file:<br />

1 "guzzlehttp/guzzle": "~5.3|~6.0"<br />

Mailgun Driver<br />

To use the Mailgun driver, first install Guzzle, then set the driver option in your config/mail.php<br />

configuration file to mailgun. Next, verify that your config/services.php configuration file<br />

contains the following options:<br />

1 'mailgun' => [<br />

2 'domain' => 'your-mailgun-domain',<br />

3 'secret' => 'your-mailgun-key',<br />

4 ],<br />

¹⁸⁹http://swiftmailer.org<br />

397

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!