email validation in laravel
'email' => 'required|email|unique:users,email',
//@sujay
email validation in laravel
'email' => 'required|email|unique:users,email',
//@sujay
send multiple mail in laravel
$emails = ['[email protected]', '[email protected]','[email protected]'];
Mail::send('emails.welcome', [], function($message) use ($emails)
{
$message->to($emails)->subject('This is test e-mail');
});
var_dump( Mail:: failures());
exit;
send html email laravel
// $data => array of information passed to view
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!');
});
laravel send email
// admin.newsletters.send_email : is the blade that will have your email content
// 'newsletter' => $newsletter : is the collection to be used in the blade file
// function ($message) : the function email and the variable to be used in the message.
// use ($newsletter) : is the collection to be used in the message controller (e.g $message->to($newsletter->email))
// Swift_TransportException to check if it is real email
namespace App\Http\Controllers\Admin;
use Mail;
public function sendEmail(Newsletter $newsletter)
{
try {
Mail::send('admin.newsletters.send_email', ['newsletter' => $newsletter], function ($message) use ($newsletter) {
$message->from('[email protected]', 'eee-services.com');
$message->to('[email protected]')->subject('Newsletter');
});
} catch (\Swift_TransportException $e) {
if ($e->getMessage()) {
return redirect()->route('admin.newsletters.index');
}
}
return redirect()->route('admin.newsletters.index');
}
email validation in laravel
$validator = Validator::make($request->all(), []);
$validator->sometimes('email', 'unique:users,email', function ($input) {
return $input->email !== Auth::user()->email;
});
//@sujay
laravel mail send text
Mail::raw('Text to e-mail', function ($message) {
//
});
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us