Laravel provides a clean and straightforward API over the popular SwiftMailer library with drivers for SMTP, Mailgun, SparkPost, Amazon SES, and send an email. Laravel is allowing us to send Mail quickly through local or cloud-based services.

Below is an example with sending email through the mail().

It allows us to store our email messages in views files. For example, to organize your emails, you can create an email directory within your resources/views directory.

Example

                                        
public function sendEmail(Request $request, $id)
    {
        $user = Admin::find($id);

        Mail::send('emails.reminder', ['user' => $user], function ($m) use ($user) {
            $m->from('info@bestinterviewquestion.com', 'Reminder');

            $m->to($user->email, $user->name)->subject('Your Reminder!');
        });
    }

Suggest An Answer

No suggestions avaliable!