当我将电子邮件保存在 laravel 6 的数据库中时,如何发送包含电子邮件 ID 和消息的电子邮件?
公共函数 html_email(请求 $request) {
$mail = new \App\Mail();
$mail->name = $request->input('name');
$mail->email = $request->input('email');
$mail->message = $request->input('message');
$mail->save();
$mail = array('name' => "$request->name");
Mail::send(['text' => 'mail'], $mail, function ($message) {
$message->to('[email protected]', 'Test Point') **//how can i fetch the email id here in $mail->email ?**
->subject('Laravel HTML Testing Mail');//how can i fetch the message here?
$message->from('[email protected]', '$name');
});
echo "HTML Email Sent. Check your inbox.";
return view('welcome');
}
将数据保存到数据库后如何获取数据,并通过电子邮件发送数据?基本上,我想在联系页面中使用它。
public function html_email(Request $request)
{
$mail = new \App\Mail();
$mail->name = $request->input('name');
$mail->email = $request->input('email');
$mail->message = $request->input('message');
$mail->save();
$mail = array('name' => "$request->name");
Mail::send(['text' => 'mail'], $mail, function ($message) {
$message->to('[email protected]', 'Test Point') **//how can i fetch the email id here in $mail->email ?**
->subject('Laravel HTML Testing Mail');//how can i fetch the message here?
$message->from('[email protected]', '$name');
});
echo "HTML Email Sent. Check your inbox.";
return view('welcome');
}
how can I fetch the data after saving it in the database, and send the data in an email? Basically, I want to use it in contact page.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这里变量声明
Here the variable declare