I have solved this problems by myself. Wrap the try and catch with Mail::send. Here's how I do it.
try{
Mail::send("emails.contact", $data, function($message)
{
$from = Input::get("email");
$to = "[email protected]";
$guestName = Input::get("fullname");
$subject = "問い合わせ";
$message->from($from, $guestName);
$message->to($to);
$message->subject($subject);
});
}catch(Exception $e){
return Redirect::to('/#contact')
->withErrors($e->getMessage())
->withInput(Input::all());
}
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community