I want to do email verification. Actually, it succeeded, but only to the email in the .env file. Why didn’t other users receive the email verification link?
Model
class User extends Authenticatable implements MustVerifyEmail
web
Auth::routes(['verify' => true]);
controller
$this->middleware(['auth', 'verified']);
.env
MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
[email protected]
MAIL_PASSWORD=zdmqlfstftkdvrsz
MAIL_ENCRYPTION=tls
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="Travel"
Why was it only sent to mymail but not to other emails?
3
Answers
You could try to make MAIL_FROM_ADDRESS equal to MAIL_USERNAME. If that does not match it can be disallowed
If you want to debug this further, you can temporarily modify the
sendEmailVerificationNotification()
method in your User model to log some info.MAIL_FROM_ADDRESS needs to be an actual email address that exists. I realized that made-up email addresses like "[email protected]" don’t work.