laravel send email code example
Example 1: email validation in laravel
'email' => 'required|email|unique:users,email',
Example 2: send html email laravel
Mail::send('email_view', $data, function ($m) use ($user) {
$m->from("[email protected]", config('app.name', 'APP Name'));
$m->to($user->email, $user->email)->subject('Email Subject!');
});
Example 3: email validation in laravel
'user.email' => 'required|email|unique:users,email,'.$user->id,
Example 4: laravel mail to specific email
$to = [
[
'email' => $email,
'name' => $name,
]
];
\Mail::to($to)->send(new \App\Mail\Hello);