Laravel 5通过mandrill错误发送电子邮件

时间:2015-12-15 07:51:05

标签: php email laravel laravel-5 mandrill

我的mail.php`

>>> [list(col) for col in zip(*[d.values() for d in myList])]
[[0, 1], [2, 3]]
在我的控制器中保存一些数据库表中的一些信息后,存储方法代码是代码

'driver' => 'mandrill',
'host' => 'smtp.mandrillapp.com',
'port' => 587,
'from' => ['address' => 'mohaimin.moin10011@gmail.com', 'name' => null],
'encryption' => 'tls',
'username' => 'mohaimin.moin10011@gmail.com',
'password' => 'mandrill-api-key',
'sendmail' => '/usr/sbin/sendmail -bs',
'pretend' => false,`

我的路线是

 public function store()
    {
        $message = "";
            $qccheck = new Qccheck();
                $qccheck->DateOfCheck = Input::get('DateOfCheck');
                $qccheck->ReferenceNo = Input::get('ReferenceNo');
                $qccheck->Comment = Input::get('Comment');
                $qccheck->CheckById = Input::get('CheckById');
                $qccheck->ExpectedValue = Input::get('ExpectedValue');
                $response = $qccheck-> save();

                $checkDetails = Input::get('qccheckdetails');
                $checkDetailsqty = Input::get('qccheckdetailsqty');

                $contactName = 'Moin';//Input::get('name');
                $contactEmail = 'mohaimin.moin10011@gmail.com';//Input::get('email');
                $contactMessage = 'Quality Check';//Input::get('message');
                $DateOfCheck = Input::get('DateOfCheck');
                $Formatdate = date("d-m-Y", strtotime($DateOfCheck));
            $ReferenceNo = Input::get('ReferenceNo');
            $Comment = Input::get('Comment');
            $b = Input::get('qccheckdetailsqty');
                $data = array(
                    'name'=>$contactName, 
                    'email'=>$contactEmail, 
                    'messageObj'=>$contactMessage,
                    'checkdate'=>$Formatdate,
                    'refno'=>$ReferenceNo,
                    'ct'=>$Comment,
                    'b'=> Input::get('qccheckdetailsqty') 

Mail::send('emails.email' ,$data, function($message) use ($contactEmail, $contactName)
{   
    $message->from($contactEmail, $contactName);
    $message->to('esharif21@gmail.com')->subject('Mail send cheque');
});


                if(count(Mail::failures()) > 0){

                    $message = "Email not send";
                }
                else
                {

                    $message = "Email Sent!";
                }
            }
        return $message;
    }

我的emails.email视图是

Route::post('/storeQccheck', 'QccheckController@store');

但不是发送电子邮件,而是显示 <!DOCTYPE html> <html lang="en-US"> <head> <meta charset="utf-8"> </head> <body> <div> Checking date {!! $checkdate !!} and the Reference is {!! $refno !!} and Comment {!! $ct !!}. </div> </body> </html> 。我的代码中出了什么问题,哪里出错了。

0 个答案:

没有答案