0

my current php mail cannot be send out (no error, all can run well, but only cannot send out notificant email), and my code as attached.

enter image description here

if (isset($_POST["normal"])) { // check if normal leave form was submitted
  $insert = "INSERT INTO leave_applications (type, date_from, date_to, reason, days, submitted_on, notice, status, users_id)
  VALUES ('$type', '$ifrom', '$ito' , '$reason1' ,'$days', '$date', 'normal', 'Pending', '$id')";

  $headers  = 'MIME-Version: 1.0' . "\r\n";
  $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
  $headers .= "From:" . "limwenwei1997@gmail.com". "\r\n";
  $headers .= "Cc: wenwei.lim@screamingtomatoes.com" . "\r\n";

$message = '<p><strong>This is strong text</strong> while this is not.</p>';

  $admin = "wenwei.lim@voodoocomms.com";
  $applicant = "limwenwei1997@gmail.com";
  $subject = "Tomato Portal: New Leave Submission";




  mail($admin,$subject,$message,$headers);




} else {
  $insert = "INSERT INTO leave_applications (type, date_from, date_to, days, submitted_on, notice, status, users_id)
  VALUES ('$type', '$ifrom', '$ito' ,'$days', '$date', 'short', 'Pending', '$id')";
  $headers  = 'MIME-Version: 1.0' . "\r\n";
  $headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
  $headers .= "From:" . "limwenwei1997@gmail.com". "\r\n";
  $headers .= "Cc: wenwei.lim@screamingtomatoes.com" . "\r\n";

$message = '<p><strong>This is strong text</strong> while this is not.</p>';

  $admin = "wenwei.lim@voodoocomms.com";
  $applicant = "limwenwei1997@gmail.com";
  $subject = "Tomato Portal: New Leave Submission";




  mail($admin,$subject,$message,$headers);

}

Please someone help to reach me out,k thanks

Wen Wei
  • 33
  • 4

1 Answers1

0

Some time server administrator disables mail function for preventing user to send spam.

Mohammad Rajabloo
  • 2,567
  • 19
  • 20