Laravel郵件
作曲家要求
作曲命令:作曲家需要guzzlehttp /狂飲 Mail配置
爲此,你必須在配置編輯mail.php文件。
<?php
return [
'driver' => 'smtp', //your service you are using
'host' => 'smtp.gmail.com', //your mail server host
'port' => '587', //server host port
'from' => ['address' => null, 'name' => null], //This is the from address. Just don’t leave it null, it must have a from address. I corrected this at another place, but not needed if you fill this one in.
'encryption' => 'tls', //security type
'username' => '[email protected]', //username
'password' => 'password', //password
'sendmail' => '/usr/sbin/sendmail -bs', //sent items file
'pretend' => false, //This must just be false don’t know why
];
如何使用郵件類
只是把這個功能在你的控制方法之一,它將運行 簡單,因爲這功能:
Mail::send('app', ['var name to pass to view' => 'its value'], function($message)
{
$message->to('[email protected]', 'name surname')->subject('Testing out laravels mail');
//$message->from('[email protected]');
});
是啊,你猜對了我在這裏糾正它,進入這裏的形式大聲笑。發送功能需要3個參數。第一個是你想要通過電子郵件作爲主體的視圖。我剛剛測試了應用程序視圖。它的根始於視圖。第二個參數是「第二個是要傳遞給視圖的數據,通常是一個關聯數組,其中數據項可以通過$ key查看視圖。」所以我想出了第二個參數是如何工作的......它是數據你發送到視圖。第三是設置你可以改變。
現在使用Gmail或者只是在任何情況下進行測試。
祝你好運,我希望這一個講清楚你
你的回答不提供解決問題的方法,它只是顯示的方式(一個操作系統特定的一個在那個)來安裝狂飲包,OP已經完成。 – Bogdan
上面的主要問題是guzzlehttp/guzzle與laravel 5很好地工作。我也看到他或她不確定要安裝哪個版本,所以我給出了答案。我會發表評論,但我不允許。如果安裝正確,錯誤應該在其他地方。 – master
仍然收到此錯誤:'MailgunTransport.php中的FatalErrorException第79行: Class'GuzzleHttp \ Post \ PostFile'not found' – KriiV