Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/249.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
用php发送邮件不会得到预期的结果_Php - Fatal编程技术网

用php发送邮件不会得到预期的结果

用php发送邮件不会得到预期的结果,php,Php,我在我的网站上使用了这个表单,它工作正常,但是当我在我的内容中使用额外的数据时,它停止发送,即使它没有显示有错误的消息或任何其他消息 这就是它自己的形式 <form action="" method="post"> <table width="683" border="0" cellspacing="0" cellpadding="10"> <tr> <td width="96">Full Name</td> <

我在我的网站上使用了这个表单,它工作正常,但是当我在我的内容中使用额外的数据时,它停止发送,即使它没有显示有错误的消息或任何其他消息

这就是它自己的形式

<form action="" method="post">
<table width="683" border="0" cellspacing="0" cellpadding="10">
  <tr>
    <td width="96">Full Name</td>
    <td colspan="4"><label for="textfield"></label>
    <input type="text" name="fname" id="fname" /></td>
  </tr>
  <tr>
    <td>E-mail</td>
    <td colspan="4"><input type="text" name="email" id="email" /></td>
  </tr>
  <tr>
    <td>Company</td>
    <td colspan="4"><input type="text" name="company" id="company" /></td>
  </tr>
  <tr>
    <td colspan="5">How do you rate our services and products:</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td width="120"><input type="radio" name="s_rate" id="Poor" value="Poor" />
Poor </td>
    <td width="120"><input type="radio" name="s_rate" id="Good" value="Good" />
Good </td>
    <td width="120"><input type="radio" name="s_rate" id="Very_Good" value="Very Good" />
Very Good </td>
    <td width="127"><input type="radio" name="s_rate" id="Excellent" value="Excellent" />
Excellent</td>
  </tr>
  <tr>
    <td colspan="5"><p>How did you know about us?</p></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><input type="radio" name="know" id="Google" value="Google" />
Google</td>
    <td><input type="radio" name="know" id="E_mail" value="E-mail" />
E-mail</td>
    <td><input type="radio" name="know" id="A_friend" value="A friend" />
A friend</td>
    <td><input type="radio" name="know" id="Social_Media" value="Social Media" />
Social Media</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td colspan="2"><input type="radio" name="know" id="advertisement" value="An advertisement at a  web site" />
An advertisement at a  web site</td>
    <td colspan="2"><input type="radio" name="know" id="Old_customer" value="I am an old customer" />
    I am an old customer</td>
  </tr>
  <tr>
    <td colspan="5">Would you recommend us to your friends and colleagues:</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><input type="radio" name="recommend" id="Yes" value="Yes" />
Yes </td>
    <td><input type="radio" name="recommend" id="No" value="No" />
No</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td colspan="5">Do you have any suggestions to make us improve our services?</td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td colspan="4">
    <textarea name="message" id="message" cols="45" rows="5"></textarea></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td><input type="submit" name="Submit" id="button" value="Submit" /></td>
  </tr>
</table>
</form>
我在里面放了很多数据有什么不同吗


谢谢和问候

如果您在本地主机上,它将为您提供不从本地主机端口25发送邮件的错误。为了从本地主机发送邮件,您需要或其他
smpt
选项

您可以在本地使用安装程序
SMTP
邮件服务器并测试邮件功能。

您有

<input type="submit" name="Submit" id="button" value="Submit" />

在按钮的
name
-属性中使用大写的
Submit
,但是请检查PHP脚本中的小写字母
submit

您是否尝试了
echo
ing所有操作以确保正确调用该函数?您是否有错误报告?当时没有注意到我很抱歉:)@MichaelTichoň不要抱歉…该注释对帮助操作非常有用。thanx+1对于uthanks@Oswald,您是对,只是“S”再次感谢兄弟的帮助
$content = "New feedback \n From: ".$name.",\n Email: ".$email.", \n Company: "
.$company.", \n He rate our services as: ".$s_rate.", \n He know about us from: "
.$know.", \n Would he recommend us to his friends: "
.$recommend.", \n He's suggestions was: ".$message;
<input type="submit" name="Submit" id="button" value="Submit" />
isset($_POST['submit'])