** 用PHP 發郵件例程 ,歡迎參考 **

yagcan發表於2005-01-19
** 用PHP 發郵件例程 ,歡迎參考 **

目前我採用的空間是PHP+MYSQL型別的,有關於PHP方面的程式設計問題,歡迎一起討論
我寫了一段PHP郵件例程也在下面,供參考:

例程如下:
<?
if($send){
$hearer="From:$from\nReply-To:$from\nX-Mailer: PHP/".phpversion()."\nContent-Type:text/html";
$result=mail($to,$subject,$body,$hearer);
if($result)
echo "郵件已成功傳送";
}
?>
<html>
<body>
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#6699FF">
<form method="post">
<tr bgcolor="E7E7CB">
<td width="20%" height="26">發件人:</td>
<td width="80%"><input name="from" type="text"></td>
</tr>
<tr bgcolor="E7E7CB">
<td height="25">收件人:</td>
<td><input name="to" type="text"></td>
</tr>
<tr bgcolor="E7E7CB">
<td height="24">郵件標題:</td>
<td><input name="subject" type="text" size="50"></td>
</tr>
<tr bgcolor="E7E7CB">
<td height="27">郵件內容:</td>
<td><textarea name="body" cols="60" rows="10">

相關文章