Skip to content

Instantly share code, notes, and snippets.

Last active August 18, 2016 13:55
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Sane Laravel Mail example code
// note, to use $subject within your closure below you have to pass it along in the "use (...)" clause.
$subject = 'Welcome!';
Mail::send('emails.welcome', ['key' => 'value'], function($message) use ($subject) {
// note: if you don't set this, it will use the defaults from config/mail.php
$message->from('', 'Sender Name');
$message->to('', 'John Smith')
Copy link

Hey man, i still dont get it what is a 'emails.welcome' and ['key' => 'value'] ?! would be nice if you want tell me about it :)

Copy link

shahidkarimi commented Aug 18, 2016

I dont want the template. How to send simple email to any email address?
Mail::send("","hi","Hello body")

Copy link

Sending simple email is just a headache in Laravel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment