Help me please. I do not understand the reason. Thomas works like this: a letter arrives, but data from variables in it is not displayed. So it is empty. Can someone tell me what's wrong

$mails = array('@mail'); define('MAIL_SUBJECT', 'Тема'); $headers = array(); $headers[] = "MIME-Version: 1.0"; $headers[] = "Content-type: text/plain; charset=utf-8"; $headers[] = "X-Mailer: PHP/".phpversion(); (isset($_POST['name'])) ? $name = 'Имя клиента: ' . htmlspecialchars($_POST['name']) . "\n": $name = ''; (isset($_POST['phone'])) ? $phone = 'Телефон заказчика: ' . htmlspecialchars($_POST['phone']) . "\n": $phone = ''; (isset($_POST['email'])) ? $email = 'E-mail заказчика: ' . htmlspecialchars($_POST['email']) . "\n": $email = ''; (isset($_POST['from'])) ? $from = 'Форма: ' . htmlspecialchars($_POST['from']) . "\n": $from = ''; $result = true; foreach ($mails as $val) { if (!mail($val, MAIL_SUBJECT, $name . $phone . $email . $from, implode("\r\n", $headers))) { $result = false; break; } } if ($result) { header('Location: thanks.html'); exit; } 
  • and var_dump ($ _ POST) what does it say? - rjhdby
  • Also, "Each line must be separated by the character CRLF (\ r \ n). The lines must not be longer than 70 characters.", And you have "\ n". But that's not the point. Most likely - rjhdby
  • thanks, but it didn't help - Vlad Skripkin
  • You have something wrong with $ _POST, maybe it comes up empty, because the script is written correctly and the data is sent correctly, if there is any. - Klym

0