Support the ongoing development of Laravel.io →
posted 10 years ago
Mail
Last updated 2 years ago.
0

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());

}
Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

edisonthk edisonthk Joined 30 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.