Сообщение не доходит до моей электронной почты. Каково же решение?
<?php header('Content-Type: text/html; charset=utf-8'); if(isset($_POST['email'])) { // email $email_to = "mouloublog@gmail.com"; $email_subject = "Email from:"; $first_name = $_POST['first_name']; // required $last_name = $_POST['last_name']; // required $email_from = $_POST['email']; // required $telephone = $_POST['telephone']; // not required $email_message = "Form details below.\n\n"; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message .= "First Name: ".clean_string($first_name)."\n"; $email_message .= "Last Name: ".clean_string($last_name)."\n"; $email_message .= "Email: ".clean_string($email_from)."\n"; $email_message .= "Telephone: ".clean_string($telephone)."\n"; // create email headers $headers = 'From: '.$email_from."\r\n". 'Reply-To: '.$email_from."\r\n" . 'X-Mailer: PHP/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); ?> <?php echo "<script type='text/javascript'>alert('سنتم الرد عليك في البريد الالكتروني الخاص بك لذا قم بفحصه الان وشكراا')</script>"; echo "<script> window.location.assign('../home.html'); </script>"; ?> <?php } ?>
Что я уже пробовал:
<pre><?php header('Content-Type: text/html; charset=utf-8'); if(isset($_POST['email'])) { // email $email_to = "mouloublog@gmail.com"; $email_subject = "Email from:"; $first_name = $_POST['first_name']; // required $last_name = $_POST['last_name']; // required $email_from = $_POST['email']; // required $telephone = $_POST['telephone']; // not required $email_message = "Form details below.\n\n"; function clean_string($string) { $bad = array("content-type","bcc:","to:","cc:","href"); return str_replace($bad,"",$string); } $email_message .= "First Name: ".clean_string($first_name)."\n"; $email_message .= "Last Name: ".clean_string($last_name)."\n"; $email_message .= "Email: ".clean_string($email_from)."\n"; $email_message .= "Telephone: ".clean_string($telephone)."\n"; // create email headers $headers = 'From: '.$email_from."\r\n". 'Reply-To: '.$email_from."\r\n" . 'X-Mailer: PHP/' . phpversion(); @mail($email_to, $email_subject, $email_message, $headers); ?> <?php echo "<script type='text/javascript'>alert('سنتم الرد عليك في البريد الالكتروني الخاص بك لذا قم بفحصه الان وشكراا')</script>"; echo "<script> window.location.assign('../home.html'); </script>"; ?> <?php } ?>