我正在尝试使邮件表格正常工作,这是我正在使用的代码..
<table class="mail" table width="400" border="0" align="center" cellpadding="3" cellspacing="1">
<tr>
<td><strong>Contact Form </strong></td>
</tr>
</table>
<table class="mail" table width="400" border="0" align="center" cellpadding="0" cellspacing="1">
<tr>
<td><form name="form1" method="post" action="send_contact.php">
<table class="mail" table width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td width="16%">Subject</td>
<td width="2%">:</td>
<td width="82%"><input name="subject" type="text" id="subject" size="50"></td>
</tr>
<tr>
<td>Message</td>
<td>:</td>
<td><textarea name="detail" cols="50" rows="4" id="detail"></textarea></td>
</tr>
<tr>
<td>Name</td>
<td>:</td>
<td><input name="name" type="text" id="name" size="50"></td>
</tr>
<tr>
<td>Email</td>
<td>:</td>
<td><input name="customer_mail" type="text" id="customer_mail" size="50"></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><input type="submit" name="Submit" value="Send"> <input type="reset" name="Submit2" value="Reset"></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>
这是运行的脚本..
<?php
// Contact subject
$subject ="$subject";
// Details
$message="$detail";
// Mail of sender
$mail_from="$customer_mail";
// From
$header="from: $name <$mail_from>";
// Enter your email address
$to ="email";
$send_contact=mail($to,$subject,$message,$header);
// Check, if message sent to your email
// display message "thanks for sending us a message!"
if($send_contact){
Print "<html>";
Print "<head>";
Print "<link href='styles.css' rel='stylesheet' type='text/css' />";
Print "</head>";
Print "<body>";
Print "<img src=images/banner2.png alt='banner' />";
Print "<p>Thanks for sending us a message!, please wait while you are being redirected to the homepage</p>";
Print "</body>";
Print "</html>";
}
else {
Print "<html>";
Print "<head>";
Print "<link href='styles.css' rel='stylesheet' type='text/css' />";
Print "</head>";
Print "<body>";
Print "<img src=images/banner2.png alt='banner' />";
echo "ERROR";
Print "</body>";
Print "</html>";
}
?>
当我将电子邮件放入“电子邮件”发送时,我只收到来自@localhost 的消息,我知道邮箱正在工作,因为我使用了不同的脚本,但我想使用这个脚本,因为我可以更改字体和大小。
谢谢