我正在尝试执行发送邮件功能,当记录存储在数据库中,但我得到无法访问的语句public function store(Request $request) { $visit = Visit::create($request->all()); return response()->json($visit); $this->sendEmail($request); }这是发送电子邮件功能public function sendEmail(Request $request){ $visit = Visit::create($request->all()); $host_email = Db::table('users') ->where('name', '=', $visit->visitor_host) ->value('email'); $to_name = $request->input('visitor_name'); $data = array('name'=> $to_name, "body" => "Test mail"); Mail::send('mails.mail', $data, function($message) { $message->from('cytonnvisitor@gmail.com','cytonn'); $message->to('mimikiduchu@gmail.com'); $message->subject('Visitor coming notification'); }); }
- 1 回答
- 0 关注
- 70 浏览
添加回答
举报
0/150
提交
取消