public function contact(Contact $request) { Mail::send('emails.message', ['email' => $request->input('email'), 'mess' => $request->input('message')], function ($m) { $m->to(config('mail.to.adress'), config('mail.to.name'))->subject('Message de Laravel Designer'); }); return response()->json(); }
public function send(ContactRequest $request) { $data = $request->all(); Mail::send('emails.contact', ['data' => $data], function ($message) use($data) { $message->from(env('MAIL_FROM_ADDRESS'), env('MAIL_FROM_NAME')); foreach (explode(',', env('MAIL_TO_INTERNAL')) as $name) { $message->to($name, env('MAIL_FROM_NAME'))->subject('Mensagem de ' . $data['name']); } }); }
public function postContacto(Contact $request) { $data = $request->all(); Mail::send('emails.contact', array('name' => $request->get('name'), 'email' => $request->get('email'), 'telefono' => $request->get('telefono'), 'user_message' => $request->get('mensaje')), function ($message) { $message->from('*****@*****.**'); $message->to('*****@*****.**', 'Información')->subject('Formulario Contacto'); }); Session::flash('message', 'Gracias por contactar con nosotros'); $items = $this->menu->frontEnd(); return Redirect::to('contacto'); }