i'm using smtp.gmail.com in my .env files and trying to create contact_us form in view, and everything working fine until i saw the sender.
the sender is not supposed to same as ->to() function, it should be whatever the user input in $data['email']
i see some tutorial using mailtrap and the code below working fine, but if i'm using gmail, everything working fine except the sender email or the $message->to() is not displaying
Mail::send('email.contact', $data, function($message) use ($data){
$message->from($data['email']); // e.g user_email@mail.com
$message->to(env('MAIL_USERNAME')); // my email : myemail@gmail.com
$message->subject($data['subject']);
});
help pls, thanks btw
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire