Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/290.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 从联系人表格到管理员电子邮件的Laravel 4_Php_Email_Laravel_Laravel 4_Swiftmailer - Fatal编程技术网

Php 从联系人表格到管理员电子邮件的Laravel 4

Php 从联系人表格到管理员电子邮件的Laravel 4,php,email,laravel,laravel-4,swiftmailer,Php,Email,Laravel,Laravel 4,Swiftmailer,我第一次尝试使用Laravel的邮件类,遇到了一些困难。我有一个简单的联系方式,应该作为电子邮件发送给管理员。这是我试过的 控制器(一旦我能让它工作,它将被重构为模型) 查看 {{ Form::open(array('action' => 'ContactController@store', 'class' => 'row', 'id' => 'contact')) }} {{ Form::label('name', 'Name') }} {{ Form::

我第一次尝试使用Laravel的邮件类,遇到了一些困难。我有一个简单的联系方式,应该作为电子邮件发送给管理员。这是我试过的

控制器(一旦我能让它工作,它将被重构为模型)

查看

 {{ Form::open(array('action' => 'ContactController@store', 'class' => 'row', 'id' => 'contact')) }}

    {{ Form::label('name', 'Name') }}
    {{ Form::text('name', '', array('class' => 'full')) }}

    {{ Form::label('email', 'Email') }}
    {{ Form::email('email', '', array('class' => 'full')) }}

    {{ Form::label('message', 'Message') }}
    {{ Form::textarea('message', '', array('class' => 'full')) }}

    {{ Form::submit('Send Now', array('class' => 'btn btn-large btn-primary')) }}

 {{ Form::close() }}

@include ('_partials.errors')
当我填写联系人表单并点击发送时,我收到以下错误:

Argument 2 passed to Illuminate\Mail\Mailer::send() must be of the type array, string given

将数据变量设置为数组:

$data = array( 'message' => Input::get('message') );
$data = array( 'message' => Input::get('message') );