The TutsPlus.com site has posted a tutorial for the users out there showing you how to send emails with built-in functionality via the framework’s Mail API.

In this article, we’re going to explore the Mail API in the Laravel web framework. Laravel takes advantage of the popular SwiftMailer library, which is easy to use and comes with a variety of email drivers to choose from. In the latter stages of the article, we’ll go through an in-depth demonstration of the concepts in the first half of the article.

The tutorial starts with the setup and configuration you’ll need to get the mail up and running. They don’t help you set up the backend (like sendmail or Mailgun) but they do describe the options in the configuration required for methods like SMTP sending and local sending. Next they show an example of a "mailable" class that creates a "demo" email and defines various settings including the "from" address, the content (from a view), variables to pass to the view and an image attachment. The view for the example is also included, making use of the Blade templating to replace placeholders with variable values.



Source link

LEAVE A REPLY

Please enter your comment!
Please enter your name here