** 用PHP 发邮件例程 ,欢迎参考 **
目前我采用的空间是PHP+MYSQL类型的,有关于PHP方面的编程问题,欢迎一起讨论
我写了一段PHP邮件例程也在下面,供参考:
+ k" k, x1 y" m% L
例程如下:
<? 5 n4 g3 P3 |, f& W8 b& q, h3 s
if($send){ ; O Y! c- i. r( o- [: W8 S" ^% v
$hearer="From
from\nReply-T$from\nX-Mailer: PHP/".phpversion()."\nContent-Type:text/html"; 2 ^' V4 i) a6 z' R+ _; E9 s `' a
$result=mail($to,$subject,$body,$hearer);
if($result) 9 t% W& ?) j7 E
echo "邮件已成功发送"; ! D4 K4 `( }+ j$ h0 L; `
} 2 a) ], U4 e" a: [) l% n& _
?>
<html>
<body>
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#6699FF"> % u h, _3 u' g; w' P: {! F
<form method="post">
<tr bgcolor="#E7E7CB">
<td width="20%" height="26">发件人:</td>
<td width="80%"><input name="from" type="text"></td> * L8 `/ N3 I! \+ l
</tr>
<tr bgcolor="#E7E7CB">
<td height="25">收件人:</td> 0 n5 b d! x$ W2 x4 u# C' t
<td><input name="to" type="text"></td> . H% k) T4 T* Y! p; x
</tr> 4 c/ X/ |" Y: G3 Y
<tr bgcolor="#E7E7CB">
<td height="24">邮件标题:</td> + u- d7 }! c3 Y+ x6 X$ G- g
<td><input name="subject" type="text" size="50"></td>
</tr> 2 C7 H+ l1 ]' p& q. R# w8 }
<tr bgcolor="#E7E7CB"> 0 y. S9 @& J9 L* v$ [
<td height="27">邮件内容:</td> 5 y! O5 I5 p% W) y: `" c6 L7 g) v
<td><textarea name="body" cols="60" rows="10"></textarea></td> . e+ Y" F* N( U: [$ n& a
</tr>
<tr bgcolor="#E7E7CB"> $ H1 j7 w0 a6 g/ ]9 E4 v6 f
<td height="28"> </td> 7 ~+ I3 o$ |0 w9 E/ V
<td>
<input type="hidden" value="1" name="send">
<input type="submit" name="Submit" value="提交"> 7 d. h9 }/ M2 H6 s. Y( W; P
<input type="reset" name="Submit2" value="重置"></td> + h4 ^( W$ W, j, S& f
</tr> % H p0 t% |& p4 E0 P
</form> * d1 [$ l5 e5 _5 H7 D: v! J
</table>
</body> 9 L) A- _$ P8 z% n3 x
</html> / j- _; _+ N! Z3 e( {1 [! `9 K
--------------------------------------------------------------------------------
时代互联 (www.now.net.cn/host) 的PHP 虚拟主机性能:
PHP4.3.6 GD2.1x mhash iconv 支持Zend 加速及加密 XML kerberos IMAP ZLIB CURL
Apache2 PHP 内核整合 MySQL4.0.17 带phpMyAdmin 管理后台 支持网站访问统计
1 ~" L! }/ F. V: I! t5 m
★送免费的留言板和计数器 ,流量访问系统
推荐类型:
- v# n- {$ L( I+ b% Z
商务型B+.CN域名 送800M 空间邮箱 1300元/年
点击: http://now.net.cn/host/commerce.net?PHPSESSID=aca5c80915ad9bcc097e352cf57e9d61
O1 v! U, g* J+ ^. V& h% [! d7 u2 C9 m" z虚拟专用型B+.CN域名+国际顶级域名 送2000M VIP 企业邮局 配置MYSQL数据库 3800元/年 ) C6 R: l# c( B4 [3 M. k8 S @4 D( {5 c' f x' `3 ? 订购地址:: y$ L" Q1 Q' J http://now.net.cn/host/vps.net?PHPSESSID=aca5c80915ad9bcc097e352cf57e9d61 ------------------------------------------------------------------------------- 虚拟主机的优势: http://now.net.cn/news/MessView.net?IDMessage=4607 全球免费咨询电话,请点击 http://www.now.net.cn/customer/moreline.net , C8 ]( P; |. H( l5 ] Q Q在线咨询:188092185 108786612 TEL:0756-3813159 3813160
| 欢迎光临 数学建模社区-数学中国 (http://www.madio.net/) | Powered by Discuz! X2.5 |