1

I have built a simple php validation with mail() in PHP and the mail doesn't go to the mail but the information in transferred through post. Thanks to the helpers.

<?php
 if ((isset($_POST['name'])) && (isset($_POST['phone']))) {

  $name = $_POST['name'];
  $phone = $_POST['phone'];

  $to = "a0524553300a@gmail.com";

  $subject = 'חום התיכון - טופס יצירת קשר ';
  $headers = "From: $email" . "\r\n";
  $headers .= "MIME-Version: 1.0" . "\r\n";
  $headers .= "Content-type: text/html; charset=utf-8";

  $replymessage = "<html>
  <head>
  <meta http-equiv='content-type' content='text/html; charset=utf-8' />
  </head>
  <body style='    direction: rtl;'>
  <div>
  <span>שם: </span>
  <span>$name</span>
  </div>
  <br/>
      <div>
  <span>טלפון: </span>
  <span>$phone</span>
  </div>
  </body>
  </html>";

  mail($to, $subject, $replymessage, $headers);

  return true;
 }
 ?>
Amit Gupta
  • 2,771
  • 2
  • 17
  • 31
Edi Abrmov
  • 11
  • 2
  • Do you use xamp? – Melody Jan 04 '18 at 09:56
  • 9
    Remember `mail()` does not actually send an email, it just passes the mail to an email server. Do you have an email server? If you are using Windows, that does not come with an email server by default. In which case its probably easier to use the `phpMailer` library to send emails – RiggsFolly Jan 04 '18 at 09:59
  • i uploded the page to linux server – Edi Abrmov Jan 04 '18 at 10:35

0 Answers0