Answer the question
In order to leave comments, you need to log in
How to set up email verification in Laravel to send from another email?
Hello!
I set up email verification according to the documentation in Laravel 8, everything works fine.
But, it is required to send not from the main box, but from an additional one.
I set up an additional mailbox in mail.php and in .env
Is there a way to make it send from an additional mailbox during verification?
Answer the question
In order to leave comments, you need to log in
In general, I decided myself.
In App\Models\User overridden method:
public function sendEmailVerificationNotification()
{
$this->notify(new VerificationEmail());
}
protected function buildMailMessage($url)
{
return (new MailMessage)
->mailer('activate')
->from('[email protected]', config('app.name'))
->subject(Lang::get('Verify Email Address'))
->line(Lang::get('Please click the button below to verify your email address.'))
->action(Lang::get('Verify Email Address'), $url)
->line(Lang::get('If you did not create an account, no further action is required.'));
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question