大家好,编码已经消失,邮件是在主机上创建的 ps.kz 请帮忙。支持人员被告知添加 utf-8。这是代码:
public function form()
{
$this ->validate(request(), [
'name'=>'required',
'phone'=>'required',
]);
$message = "Name: ".request('name')."\nPhone:"
.request('phone');
$subject = "Form from test.kz";
$headers = 'From: info@test.kz' . "\r\n" .
'Reply-To: info@test.kz' . "\r\n".
'X-Mailer: PHP/' . phpversion();
mail('test@test.kz', $subject, $message, $headers);
// return response()->json(['msg' => request()->all()]);
return view('pages.start');
}
$headers
您需要为变量添加编码:来源: https ://www.php.net/manual/ru/function.mail.php