PHP问题 - 邮件服务器被列入黑名单

时间:2011-06-09 00:55:58

标签: php email post exec

我的托管公司现在说他们的“(8)Exec格式错误:执行'/ home / failed” 就是“邮件服务器ip被列入黑名单”

WTF的意思是,我该如何解决? 拜托,我准备把头发撕掉。谢谢。

以前的问题已解决: *我的托管公司已禁用多个PHP功能。这对我来说实际上没有任何影响,但我似乎得到了他们的一个禁用功能错误。错误是 “(13)许可被拒绝:'/home/exampledomain/public_html/cgi-bin/emailscript.php'的执行失败” 我已经超过了我的PHP十几次了,而且我没有exec()函数。我唯一的功能是mail(),他们发誓工作得很好。我一直在通过他们的客户支持,他们拒绝告诉我发生了什么。*

我发布了我的代码以供审核。请帮忙。感谢。

<?php

/* Subject and Email Variables */

    $emailSubject = 'Appointment Inquiry';
    $webMaster = 'info@exampledomain.com';

/* Gathering Data Variables */

    $nameField = $_POST['name'];
    $cellField = $_POST['cell'];
    $emailField = $_POST['email'];
    $dateField = $_POST['date'];
    $timeField = $_POST['time'];
    $lengthField = $_POST['length'];
    $detailsField = $_POST['details'];
    $otherField = $_POST['other'];
    $screennameField = $_POST['screenname'];
    $companyField = $_POST['company'];
    $worknoField = $_POST['workno'];
    $switchboardnoField = $_POST['switchboardno'];
    $memoField = $_POST['memo'];
    $subscribeField = $_POST['subscribe'];

    $body = <<<EOD
<br><hr><br>
Name: $name <br>
Cellphone: $cell <br>
Email: $email <br>
Date: $date <br>
Time: $time <br>
Length of appointment: $length <br>
Details: $details <br>
Other: $other <br>
Screen Name: $screenname <br>
Company: $company <br>
Direct Line: $workno <br>
Switchboard: $switchboardno <br>
Memo: $memo <br>
Subscribe Me: $subscribe <br>
EOD;

    $headers = "From: $email\r\n";
    $headers .= "Content-type: text/html\r\n";
    $success = mail($webMaster, $emailSubject, $body, $headers);

/* Results rendered as HTML */

    $theResults = <<<EOD
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>My Hosting Company Sucks</title>
<link rel="shortcut icon" href="images/favicon.ico" />

<style type="text/css">
<!--
body {
    background-color: #401857;
    background-image: url(Images/bg.jpg);
    background-repeat: repeat-x;
}
-->
</style>
</head>

<body ondragstart="return 
false" onselectstart="return false">
<div id="wrapper">
  <div id="logo"><a href="index.html"><img src="Images/logo.jpg" width="800" height="250" alt="logo" /></a></div>
  <div id="navigation">
    <p>&nbsp;</p>
    <p class="link_cls"><a href="index.html"> Page1</a> | <a href="page2.html">Page2</a> | <a href="page3.html">Page3</a> | <a href="page4.html">Page4</a> | <a href="page5.html">Page5</a> | <a href="page6.html">Page6</a></p>
  </div>

    <div id="bodyArea">
  <div id="center">
    <p>&nbsp;</p>
    <p>&nbsp;</p>
    <p><img src="images/thankyou.jpg" alt="thanks" width="579" height="502" align="middle" /></p>
  </div>
  </div>
</div>


</body>
</html>
EOD;
echo "$theResults";

?>

1 个答案:

答案 0 :(得分:0)

错误不是指exec()函数,而是指php文件本身的实际执行。 PHP文件需要被文件系统视为可执行文件,以便服务器处理它们。您的文件权限似乎已关闭文件。标准是权限级别为755。

您应检查该文件的文件权限,并在必要时进行更改。