Send email in laravel
Email in laravel can be send using SMTP.
Email in laravel can be send using SMTP.
use Illuminate\Support\Facades\Mail;
$details = Model::where('id', $id)->first();
$datamail = array();
$datamail['firstname'] = $details->first_name;
$datamail['lastname'] = $details->last_name;
$datamail['email'] = $details->email;
$datamail['phone'] = $details->phone;
$datamail['admin_email'] = 'johndoe@gmail.com';
Mail::send('emails.templatename', $datamail, function ($message) use ($datamail) {
$message->from('noreply@domainname.com', 'Domain Name');
$message->to($datamail['admin_email']);
$message->cc(['name1@domainname.com','name2@domainname.com']);
$message->subject('Email Subject Here.');
});
0 Comment's
Add Comment
Register to Reply
Login
Register