Trying to send an email using Laravel but keep getting a 405 error and the whoops page showing:
* @param array $others
* @return void
*
* @throws \Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException
*/
protected function methodNotAllowed(array $others)
{
throw new MethodNotAllowedHttpException($others);
}
The code is:
{{ Form::open(array('url' => 'admin/newemail')) }}
// form items
{{ Form::close() }}
And the route is:
Route::get('admin/newemail', function()
{
$email = 'email@hotmail.com';
$data = array('s' => Input::get('email-heading'));
Mail::send('emails.wereback', $data, function($message) use ($email){
// $message details
});
});
However, if I directly go to the url admin/newemail it works fine.
Any help?