mercredi 24 février 2016

email sends whole html page(instead of email body) in laravel 5.1

i'm making contact form. if someone fills in form, these data(text,subject) should be sent to my mail. everything's work, but when I fill in form and send mail, it sends whole html page (not text from form). here's how it looks like

printscreen

here's my controller where i send mail

 public function sendEmail(Request $request)
{

    $data["username"] = $request->username;
    $data["email"] = $request->email;
    $data["subject"] = $request->subject;
    $data["mail_text"] = $request->mail_text;

    Mail::send('contact', ["data" => $data], function ($mail) use ($data){

        $mail->to("leribobo@gmail.com")->from($data["email"])->subject($data["subject"]);

    });

    return redirect()->back();
}

as i guess it sends 'contact' page, which is first parameter in method

 Mail::send('contact' .... 



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire