K
K
kursof12018-11-02 09:15:50
PHP
kursof1, 2018-11-02 09:15:50

How to fix the receipt of the mail?

Received by server email. X-Mailer:PHP/[email protected] and does not always come. but it is necessary that my [email protected] enter

<?php

$post = (!empty($_POST)) ? true : false;

if($post){
$email = trim($_POST['email']);
$name = htmlspecialchars($_POST['name']);
$email = htmlspecialchars($_POST['email']);
$message = htmlspecialchars($_POST['message']);
$tel = htmlspecialchars($_POST["tel"]);
$phonefull = htmlspecialchars($_POST["phone-full"]);
$error = '';

if(!$name){
$error .= 'Пожалуйста введите ваше имя.<br />';}


if(!$tel){
$error .= "Пожалуйста введите телефон.<br />";}

if(!$error){


$subject ="Заявка с сайта ";
$name_tema = "=?utf-8?b?". base64_encode($name) ."?=";
$message ="\n\nИмя: ".$name."\n\nНомер телефона: ".$tel."\n\nСообщение: ".$message."\n\n";
$mail = mail("куда@gmail.com", $subject, $message,

"From: откого@сайт.com.ua"."Reply-To: ".$email." "." X-Mailer: PHP/" . phpversion());


if($mail)
{ echo 'OK';
}

}else 

{echo '<div class="notification_error">'.$error.'</div>';
}

}

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question