validate([ 'name' => 'required|string|max:255', 'email' => 'required|email', 'message' => 'required|string|max:5000', ]); $to = 'mike@opentextsummaries.com'; $subject = 'Contact form message from ' . $data['name']; $body = "Name: {$data['name']}\nEmail: {$data['email']}\n\nMessage:\n{$data['message']}"; // Send using simple raw email (will go to log in local env per .env) Mail::raw($body, function ($message) use ($to, $subject, $data) { $message->to($to) ->subject($subject) ->replyTo($data['email'], $data['name']); }); return back()->with('success', 'Thank you! Your message has been sent.'); } }