<?php if (isset($_POST['contactFF'])) { $to = "my-mail@yandex.ru"; // тут стоит верный адрес проверил много раз $from = $_POST['contactFF']; $subject = "Заполнена контактная форма с ".$_SERVER['HTTP_REFERER']; $message = "Имя: ".$_POST['nameFF']."\nТелефон: ".$_POST['phone']."\nEmail: ".$from."\nСообщение: ".$_POST['messageFF']; $boundary = md5(date('r', time())); $filesize = ''; $headers = "MIME-Version: 1.0\r\n"; $headers .= "From: " . $from . "\r\n"; $headers .= "Reply-To: " . $from . "\r\n"; $headers .= "Content-Type: multipart/mixed; boundary=\"$boundary\"\r\n"; $message=" Content-Type: multipart/mixed; boundary=\"$boundary\" --$boundary Content-Type: text/plain; charset=\"utf-8\" Content-Transfer-Encoding: 7bit $message"; for($i=0;$i<count($_FILES['fileFF']['name']);$i++) { if(is_uploaded_file($_FILES['fileFF']['tmp_name'][$i])) { $attachment = chunk_split(base64_encode(file_get_contents($_FILES['fileFF']['tmp_name'][$i]))); $filename = $_FILES['fileFF']['name'][$i]; $filetype = $_FILES['fileFF']['type'][$i]; $filesize += $_FILES['fileFF']['size'][$i]; $message.=" --$boundary Content-Type: \"$filetype\"; name=\"$filename\" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=\"$filename\" $attachment"; } } $message.=" --$boundary--"; if ($filesize < 20000000) { // проверка на общий размер всех файлов. Многие почтовые сервисы не принимают вложения больше 10 МБ mail($to, $subject, $message, $headers); echo $_POST['nameFF'].', Ваше сообщение получено, спасибо!'; } else { echo 'Извините, письмо не отправлено. Размер всех файлов превышает 20 МБ.'; } } ?> 
 <div id="test-form" class="white-popup-block mfp-hide col-lg-offset-2 col-md-offset-2 col-sm-offset-2 col-xs-offset-2 col-lg-8 col-md-8 col-sm-8 col-xs-8"> <form enctype="multipart/form-data" method="post" id="feedback-form" class="pad" action="mail.php"> <div class="form-group"> <label for="nameFF" class="control-label">Имя</label> <div class=""> <input type="text" name="nameFF" id="nameFF" class="form-control" placeholder="например, Иван Иванович Иванов"> </div> </div> <div class="form-group"> <label for="contactFF" class="control-label">Email</label> <div class=""> <input type="email" name="contactFF" id="contactFF" class="form-control" placeholder="ivan@yandex.ru"> </div> </div> <div class="form-group"> <label for="phone" class="control-label">Телефон</label> <div class=""> <input type="tel" id="phone" name="phone" class="form-control" placeholder="+380*********"> </div> </div> <div class="form-group"> <label for="fileFF" class="control-label">Прикрепить фото</label> <div class="input-group"> <span class="input-group-btn"> <span class="btn btn-primary btn-file"> Browse&hellip; <input type="file" name="fileFF[]" id="fileFF" multiple> </span> </span> <input type="text" class="form-control" readonly> </div> </div> <div class="form-group"> <label for="messageFF" class="control-label">Текст сообщения:</label> <div class=""> <textarea id="messageFF" name="messageFF" rows="3" class="form-control" placeholder="Информация о усопшем: 'ФИО, дата рождения-смерти, эпитафия'. Также вы можете указать номер понравившегося пейзажа 'пейзаж №', возможен индивидуальный заказ пейзажа"></textarea> </div> </div> <div class="form-group"> <input value="Отправить" type="submit" id="submitFF" class="btn btn-primary"> </div> </form> </div> 

Closed due to the fact that it was off topic by Nicolas Chabanovsky Apr 7 '16 at 4:48 .

It seems that this question does not correspond to the subject of the site. Those who voted to close it indicated the following reason:

  • “Questions asking for help with debugging (“ why does this code not work? ”) Should include the desired behavior, a specific problem or error, and a minimum code for playing it right in the question . Questions without an explicit description of the problem are useless for other visitors. See How to create minimal, self-sufficient and reproducible example . " - Nicolas Chabanovsky
If the question can be reformulated according to the rules set out in the certificate , edit it .

  • What error does the mail () function return? - Shadow33
  • Try to write more detailed questions. Explain exactly what you see the problem, how to reproduce it, what you want to get as a result, etc. - Nicolas Chabanovsky

1 answer 1

If the sending worked and suddenly ceased, then check the IP of your server to get into the DNSBL. I highly recommend to redo the sending via the mail function to send via a socket with authorization and preferably via SSL / TLS. Alternatively, you can raise a separate mail server with a "clean" dedicated IP and send mail through it.

  • Or at least a library for sending mail - Naumov
  • The problem is that the code did not give any error and wrote that everything is fine. As a result, as it turned out, the problem was related to the hosting on which the site was hosted. If anyone found the solution to be useful here the link is Anton Tretyak