我正在创建一个需要向每个模具插件发送电子邮件的应用程序。我使用Laravel的可邮寄工具,但每当我发送电子邮件时,它最终会落入垃圾邮件箱。
我发送电子邮件的表单
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Laravel</title>
</head>
<body>
<div class="flex-center position-ref full-height">
<form action="{{ route('sendmail')}}" method="post">
<input type="email" name="mail" placeholder="mailaddress">
<input type="text" name="title" id="title" placeholder="title">
<button type="submit">Send me a mail</button>
{{ csrf_field() }}
</form>
</div>
</body>
</html>
我的路线
Route::post('/sendmail', function (\Illuminate\Http\Request $request, \Illuminate\Mail\Mailer $mailer){
$mailer->to($request->input('mail'))->send(new \App\Mail\MyMail($request->input('title')));
return redirect()->back();
})->name('sendmail');
我的.ENV
配置
MAIL_DRIVER=mailgun
MAIL_HOST=smtp.mailgun.org
MAIL_PORT=2525
MAIL_USERNAME=postmaster@xxxxxxxxxxxxxxxxxxx.mailgun.org
MAIL_PASSWORD=XXXXXXXXXXXXXXXXXXXXX
MAIL_ENCRYPTION=
有什么建议吗?我尝试发送一条简单的消息,没有其他类似的html标签。但仍然要垃圾邮箱。提前谢谢!