Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

wordxpression's avatar

Sending the 'Confirmation e-mail' when using Fortify for the Auth functions

I'm quite new to Laravel. After playing around a bit, I started my first 'lets do it seriously' project using Jetstream.

Everything works fine, I've just one challenge: I can't get the Confirmation E-Mail after creating an account working.

As far as I could discover there are four steps to be taken, to make it all work.

First, have a mail server or log file ready to receive the mail. I tried this with both setting up the logfile as a receiver for the mail, and Mailtrap. Both work for all other kinds of mail I send, just not the confirmation mail.

Second, in config/fortify.php in the features array, 'emailVerification' has to be loaded :

'features' => [
        Features::registration(),
        Features::resetPasswords(),
        Features::emailVerification(),
        Features::updateProfileInformation(),
        Features::updatePasswords(),
        Features::twoFactorAuthentication([
            'confirm' => true,
            'confirmPassword' => true,
            // 'window' => 0,
        ]),
    ],

Done!

Third,

In App\Model\User.php I need to use MustVerifyEmail

use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use Laravel\Fortify\TwoFactorAuthenticatable;
use Laravel\Jetstream\HasProfilePhoto;
use Laravel\Jetstream\HasTeams;
use Laravel\Sanctum\HasApiTokens;

Done!, although VC tells me the directive is unnecessary. Is there something else to be done?

In Laravel\Fortify\Fortify, I have to add this to the boot methode :

public function boot(): void
{
    Fortify::verifyEmailView(function () {
        return view('auth.verify-email');
    });
 
    // ...
}

Done too.

Still the verification mails do not show up anywhere... not in my logfiles, when I configure the logfile for it, nor in my mailtrap account, when I have the sandbox configured.

What step am I missing?

0 likes
8 replies
LaryAI's avatar
Level 58

To troubleshoot the issue with the confirmation email not being sent, you can follow these steps:

  1. Make sure you have configured your mail driver correctly in the .env file. Check if the MAIL_MAILER value is set to a valid mail driver such as smtp or sendmail. Also, verify that the other mail-related configuration values like MAIL_HOST, MAIL_PORT, MAIL_USERNAME, and MAIL_PASSWORD are correctly set.

  2. Ensure that you have set up the mail receiver correctly. If you are using Mailtrap, double-check that you have the correct credentials (username and password) and that you are using the correct SMTP host and port.

  3. Verify that the emailVerification feature is enabled in the config/fortify.php file. You have already done this step correctly according to the code snippet you provided.

  4. Make sure your User model implements the MustVerifyEmail contract. You have already imported the MustVerifyEmail contract in your User model, so this step seems to be correct.

  5. Check if you have a verify-email.blade.php view file in the resources/views/auth directory. This is the view that will be used to display the email verification page. If the file is missing, create it with the necessary HTML and Blade syntax.

  6. Confirm that you have added the Fortify::verifyEmailView callback in the boot method of the Fortify class in app/Providers/FortifyServiceProvider.php. You have already done this step correctly according to the code snippet you provided.

If you have followed all these steps correctly and the confirmation emails are still not being sent, you can try the following additional troubleshooting steps:

  1. Clear the application cache by running the following command in your terminal:
php artisan cache:clear
  1. Ensure that your application is running in the correct environment. Check the value of the APP_ENV variable in your .env file. If it is set to production, make sure you have configured your production mail server correctly.

  2. Check if there are any error messages or exceptions being thrown when attempting to send the confirmation email. You can enable debug mode in your .env file by setting APP_DEBUG=true. This will display any error messages on the screen or in the log files.

If you have tried all these steps and the issue still persists, it might be helpful to provide more information about your Laravel and Jetstream versions, as well as any relevant error messages or log entries.

1 like
wordxpression's avatar

In addition as a reply to the AI response above, I can confirm, that I took all steps suggested. I'm using Laravel 10.15.0 Jetstream 3.24 Livewire 2.11

1 like
Snapey's avatar
Snapey
Best Answer
Level 122

@wordxpression check Lary's step 4

Its not sufficient to just use the class you must also force your class to implement it

Make sure your User model implements the MustVerifyEmail contract.

class User extends Authenticatable implements MustVerifyEmail
1 like
alex32's avatar

Thanks for sharing @snapey I've checked all the points above, but unfortunately the email still doesn't g out to the user. In the Dashboard I tried "re-send the verification email" | no email, even in the spam.

The Mail server in my VPS works just fine, not sure where the issue could be ?

Thanks

scr-shot

Snapey's avatar

@alex32 Can you send ANY email? Maybe just your email config is off.

Open tinker and type config('mail') and check the result is what you expect for your mail server

Please or to participate in this conversation.