In the previous post, we have sent an email using Mail::raw, so in this post we are going to use another method, Mail::send, with it's another properties. First... Let's change our Mail::raw to Mail:send as shown below :
Next... Let's create our emailcontent within view folder :
Yaaaps.... That's all... Let's hit "Send Mail" link {turn off antivirus first}...
Aaand... Here is our email...
Next, let's some properties to our email so change the Mail::send to be like this :
<?phpnamespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Http\Requests;
use Log;
use Mail;
classemailcontrollerextends Controller
{
publicfunctiondefaultSend()
{
Log::info("Request cycle without Queues started");
Mail::send('emailcontent', ['data'=>'data'], function ($message) {
$message->subject("Default Email");
$message->from('adiatstei07@gmail.com', 'Hisoka');
$message->to('hyosoka187@gmail.com');
$message->cc('maryadi@astrnt.co');
$message->attachData('This is my pdf Data...','hisoka.pdf');
log::info("End of mail processing...");
});
Log::info("Request cycle without Queues finished");
return redirect()->back();
}
}
Result is like this :
Yeepp... That's all for this second part... :D... B-)
Demo :