PHP邮件通知运行没有错误,但无法正常运行

时间:2018-08-03 08:17:49

标签: php email

我当前的php邮件无法发送(没有错误,所有邮件都可以正常运行,但是只能发送不重要的电子邮件),并且我的代码已附加。

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);

}

请有人帮助我,谢谢

1 个答案:

答案 0 :(得分:0)

有时服务器管理员禁用了mail功能,以防止用户发送垃圾邮件。