2013-07-21 31 views
0

這是我的html表單請求反饋。PHP表單發送來自網站的電子郵件

相應的PHP表單將放在我的web服務器上以發送電子郵件?我是網站設計新手,只學過CSS + HTML。

<table width="518" border="0"> 
      <tr> 
      <td width="165"><form name="form1" method="post" action=""> 
       <label for="nameco">Name/Company</label> 
      : 
      </form></td> 
      <td width="343"><input name="nameco" type="text" id="nameco" size="70"></td> 
      </tr> 
      <tr> 
      <td><form name="form2" method="post" action=""> 
       <label for="area">Area you are located :</label> 
      </form></td> 
      <td><input name="area" type="text" id="area" size="70"></td> 
      </tr> 
      <tr> 
      <td><form name="form3" method="post" action=""> 
       Products interested in : 
      </form></td> 
      <td><table width="198"> 
       <tr> 
       <td width="190"><label> 
        <input type="radio" name="Product" value="awnings" id="Product_0"> 
        Awnings</label></td> 
       </tr> 
       <tr> 
       <td><label> 
        <input type="radio" name="Product" value="carport" id="Product_1"> 
        Carport/Shadeport</label></td> 
       </tr> 
       <tr> 
       <td><label> 
        <input type="radio" name="Product" value="patio" id="Product_2"> 
        Patio</label></td> 
       </tr> 
       <tr> 
       <td><label> 
        <input type="radio" name="Product" value="other" id="Product_5"> 
        Other 
        <input type="text" name="other1" id="other1"> 
        </label></td> 
       </tr> 
      </table></td> 
      </tr> 
      <tr> 
      <td><form name="form4" method="post" action=""> 
       <label for="contactno">Contact Number :</label> 
      </form></td> 
      <td><input name="contactno" type="text" id="contactno" size="70"></td> 
      </tr> 
      <tr> 
      <td><form name="form5" method="post" action=""> 
       <label for="email">Email Address :</label> 
      </form></td> 
      <td><input name="email" type="text" id="email" size="70"></td> 
      </tr> 
      <tr> 
      <td><form name="form7" method="post" action=""> 
       <label for="Comments">Additional Comments :</label> 
      </form></td> 
      <td><input name="Comments" type="text" id="Comments" size="70"></td> 
      </tr> 
      <tr> 
      <td><form name="form8" method="post" action=""> 
       <input type="submit" name="Submit" id="Submit" value="Submit"> 
      </form></td> 
      <td><form name="form9" method="post" action=""> 
       <input type="submit" name="reset" id="reset" value="Reset Form"> 
      </form></td> 
      </tr> 
     </table> 

這是來自dreamweaver。我如何讓表單知道通過這個PHP文件發送?

+2

RTFM:http://php.net/mail –

+0

當然有這個教程所有在互聯網上? –

+2

值得注意的是,你實際上並沒有任何可用的表單在這個HTML中...... – David

回答

1

如果我可以給你建議,不要使用這麼多的表格,只需使用一個,並設置actionsend.php

send.php可以是這樣的:

<?php 
$to = "$_POST['email']"; 
$subject = "$_POST['subject']"; 
$message = "$_POST['message']"; 
$from = "[email protected]"; 
$headers = "From:" . $from; 
mail($to,$subject,$message,$headers); 
echo "Mail Sent."; 
?>