A
A
Alexandra0952017-08-10 15:47:01
JavaScript
Alexandra095, 2017-08-10 15:47:01

Why are messages not coming to the mail via contact.php?

<?php
 
/* Задаем переменные */
$name = htmlspecialchars($_POST["name"]);
$email = htmlspecialchars($_POST["email"]);
$tel = htmlspecialchars($_POST["tel"]);
$message = htmlspecialchars($_POST["message"]);
$bezspama = htmlspecialchars($_POST["bezspama"]);
 
/* Ваш адрес и тема сообщения */
$address = "[email protected]";
$address = "[email protected]";
$sub = "Сообщение с сайта fs29.ru";
 
/* Формат письма */
$mes = "Сообщение с сайта fs29.ru.\n
Имя отправителя: $name 
Электронный адрес отправителя: $email
Телефон отправителя: $tel
Сайт отправителя: $website
Текст сообщения:
$message";
 
 
if (empty($bezspama)) /* Оценка поля bezspama - должно быть пустым*/
{
/* Отправляем сообщение, используя mail() функцию */
$from  = "From: $name <$email> \r\n Reply-To: $email \r\n";
if (mail($address, $sub, $mes, $from)) {
  header('Refresh: 5; URL=http://fs29.ru');
  echo '<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
    <body>Письмо отправлено, через 5 секунд вы вернетесь на страницу fs29.ru</body>';}
else {
  header('Refresh: 5; URL=http://fs29.ru');
  echo '<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
    <body>Письмо не отправлено, через 5 секунд вы вернетесь на страницу fs29.ru</body>';}
}
exit; /* Выход без сообщения, если поле bezspama заполнено спам ботами */
?>

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
Stalker_RED, 2019-03-28
@Stalker_RED

I understand that /login.cgi is waiting for some kind of cookie? Which is formed in var cookie2?
You can somehow understand from this code above how to correctly form a "string",

Yes, it's waiting. Yes, it is being formed. You can understand something, but the "string" is not needed, because no one is waiting for it. Waiting for cookies.
Open a textbook or Wikipedia and read what cookies are.
And in general, it is better to throw out this script entirely - it is not safe.

W
w0key, 2017-08-10
@w0key

Have you looked at the logs? Are there any emails in spam?

D
Dmitry Gadzhiev, 2017-08-10
@gds1

your $address doubles, and where will the letter come from? to the second address.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question