I've got a class that extends Mailable where I use in it :
return $this->subject($this->email->subject . ' | ' . $this->email->name)
->from($this->email->email, $this->email->name)
->replyTo($this->email->email, $this->email->name)
->to('XXX@gmail.com')
->view('guest.mail');
This is just the classic way of sending an email. The problem I'm having is that in Gmail I get a weird message that has the from
field not using $this->email->email
but rather using XXX@gmail.com
(which is also my MAIL_USERNAME
field in my .env
).
I have no idea why. The reply to is working correctly, subject as well. It's just that the from in the email I get looks as if it was sent by XXX@gmail.com
for no logical reason to me.
Any idea what would be the issue? Did anyone ever come across an issue like that with Gmail?