vendredi 23 juin 2017

email from is displaying same as MAIL_USERNAME not as define in from() function laravel 5

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



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2rYqDMA
via IFTTT

Aucun commentaire:

Enregistrer un commentaire