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 :
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Http\Requests; use Log; use Mail; class emailcontroller extends Controller { public function defaultSend() { 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 :
Source code:
https://github.com/HyosokaPoipo/maillaravel53/tree/1._Part_2
No comments:
Post a Comment