Closed i-fail closed 4 years ago
I finally tracked the source of the problem. Your installation instructions are incomplete with one small, but very important step missing:
in config/mail.php you also have to change these two lines:
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
'name' => env('MAIL_FROM_NAME', 'Example'),
],
What happened is, MJ API would try to email with the "from" address of hello@example.com, MJ would respond with an error, and not send the email out. Because hello@example.com is not validated.
The only reason I found this out was that because the MJ account owner started receiving strange emails that said
We are contacting you as you (or one of your team members) tried to send an
email with sender address: hello@example.com. But this sender address has not
been validated yet on your account: ..."
Maybe you should add a sanity check and error_log this.
@i-fail Thanks, I updated readme file with two more settings: MAIL_FROM_ADDRESS=YOUR_EMAIL_FROM_ADDRESS MAIL_FROM_NAME=YOU_FROM_NAME
in which you can set your email and name, instead of setting them in config/mail.php, because env('MAIL_FROM_ADDRESS', 'hello@example.com') and env('MAIL_FROM_NAME', 'Example') will look first for the MAIL_FROM_ADDRESS or MAIL_FROM_NAME in .env file, and then if they are not set - it will use default values, which in your case are 'hello@example.com' and 'Example'.
Description:
Emails aren't sent on Auth user registration / verification
Steps To Reproduce:
I did all of the things below:
// User authentication routes
Auth::routes(['verify' => true]);
// MustVerifyEmail interface
class User extends Authenticatable implements MustVerifyEmail
Entered all the credentials into .env
Entered the transport string into config\mail.php
Added config/services.php
Added providers to config/app.php
Yet when I go through the user registration process, email is not sent. No error of any kind. Just not sent.
Same if I navigate to/email/verify, and click on "click here to request another", no emails are sent. Just silent 302, no errors.
Here's proof that Auth::routes work fine, everything works fine. Except emails aren't being sent.
https://www.youtube.com/watch?v=eMDy4ZSu2jY
When I manually call MailJet API with the same credentials, emails go out perfectly fine. It's just UI / Auth is not calling MailJet API.
I tried the same with simple SMTP instead of MailJet, same problem. Emails not sent.