【发布时间】:2015-04-05 22:17:15
【问题描述】:
尝试使用 Laravel 发送电子邮件,但不断收到 405 错误并显示糟糕的页面:
* @param array $others
* @return void
*
* @throws \Symfony\Component\HttpKernel\Exception\MethodNotAllowedHttpException
*/
protected function methodNotAllowed(array $others)
{
throw new MethodNotAllowedHttpException($others);
}
代码是:
{{ Form::open(array('url' => 'admin/newemail')) }}
// form items
{{ Form::close() }}
路线是:
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
});
});
但是,如果我直接转到 url admin/newemail 它工作正常。
有什么帮助吗?
【问题讨论】:
标签: php email laravel laravel-4 laravel-routing