Last active
August 18, 2016 13:55
-
-
Save alexkingorg/d2923deeea1b0076d07a to your computer and use it in GitHub Desktop.
Sane Laravel Mail example code
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// 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('[email protected]', 'Sender Name'); | |
$message->to('[email protected]', 'John Smith') | |
->subject($subject); | |
}); |
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
I dont want the template. How to send simple email to any email address?
Mail::send("[email protected]","hi","Hello body")