For some reason, the php script does not send data to the mail. I even made a record in the file to get the data received, but the recording does not occur. Did I do something wrong?
<?php // config $adminemail="andrewdymov@gmail.com"; $date=date("dmy"); $time=date("H:i"); // confirm data $name = $_POST["name"]; $email = $_POST["mail"]; $subject = $_POST["subject"]; $message = $_POST["message"]; if (!preg_match("/.+@.+\..+/i", strtolower($email))) { header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500); } else { $msg="<p>Отправлено: $time $date</p> <p>Имя: $name</p> <p>E-mail: $email</p> <p>Тема: $subject</p> <p>Сообщение: $message</p>"; mail("$adminemail", "$subject", "$msg"); $fp = fopen("test.txt", "a"); // Открываем файл в режиме записи $test = fwrite($fp, $msg); } ?>