對於這個網站,我有一個接觸的形式,它只是發送了一封郵件是這樣的:Laravel郵件工程之一,但不是還有其他
Mail::send('emails.contact', $input, function ($m) {
$m->from(Input::get('email'), Input::get('name'));
$m->to('[email protected]****.nl', 'Secretaris ****')->subject('Contactform: '. Input::get('name'));
});
的$輸入變量很簡單:
$input = Input::all();
那麼該視圖看起來是這樣的:
<html>
<body>
<b>{{$name}} ({{$mail}}) sent u a message via the contactform on ****.nl</b>
<br>
<div>
{{$message}}
</div>
<br>
</body>
</html>
此郵件確實發送。但是這一次不知何故沒有:
Mail::send('emails.registermember', $data, function ($m) {
$m->from('[email protected]****.nl', 'No-Reply ****');
$m->to('[email protected]****.nl', 'Secretaris ****')->subject('Registration of ' . ucfirst(Input::get('firstname')) . ' as Register-member');
});
的$數據這裏值爲:
$data = [
'naam' => ucfirst($user->voornaam) . ' ' . ucfirst($user->achternaam),
'id' => $user->id,
];
隨着視圖:
<html>
<body>
<p>
<b>{{$name}}</b> registered as register member at website of ****.
</p>
</body>
</html>
該郵件沒有發送和做的Mail ::失敗()返回:
[
"[email protected]****.nl",
]
我不看看這些郵件功能有什麼區別,爲什麼一個工作,另一個不工作。
出於保護隱私的原因,我與****
我希望有人能幫助我,標誌着網站名稱!
感謝
什麼郵件驅動程序是您使用正確的配置呢? –
您要發送的數據是'naam',但在視圖中,您需要放置'$ name'。 –
沒錯,我翻譯了它,但忘了翻譯它。這在我的代碼中是一樣的(naam和$ naam) –