Answer the question
In order to leave comments, you need to log in
Why are there errors when sending email to a local server when the Internet is off?
Hello, tell me please. There is a feedback form on the site, I test sending messages on the local server, if the Internet is on, everything is OK, messages come to the mail. If the Internet is turned off, I get the following error:
[16:46:01] LOG.error: [INVALID UTF-8 DATA]
[16:46:01] LOG.error: Malformed UTF-8 characters, possibly incorrectly encoded {"exception":{}}
public function index(Request $request)
{
$validator = Validator::make($request->all(), [
'name' => 'required',
'phone' => 'required|regex:/^\+?[0-9 \-()]+$/i',
'email' => 'regex:/\.*[a-z0-9A-Z][email protected]{1}[a-z0-9A-Z]+\.*/i'
]);
if($validator->fails()) {
$errors = $validator->errors();
return response()->json([
'status' => false,
'body' => array_keys($errors->messages()),
]);
}
Mail::send(new QuestionShipped($request->all()));
$msg = new letter();
$msg->store($request);
return response()->json([
'status' => true,
]);
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question