|
** 用PHP 发邮件例程 ,欢迎参考 ** ' O5 f; X7 N9 p$ J. W! g
: O. C7 N/ ]; Q* W, V/ A 目前我采用的空间是PHP+MYSQL类型的,有关于PHP方面的编程问题,欢迎一起讨论
1 D* h! K/ T$ x: S, L, @# ^/ | 我写了一段PHP邮件例程也在下面,供参考:
8 T. ~! H; |* u0 e2 i* i
6 b1 j2 z- M9 h; |6 R' }" [ 例程如下:
" v# {& w0 m) Z! y" \* s0 S) G <?
, q1 G6 z! R+ Y) u/ T# X d0 N8 F if($send){
9 c6 N) M; k+ j0 V/ a $hearer="From from\nReply-T$from\nX-Mailer: PHP/".phpversion()."\nContent-Type:text/html";
$ B4 x6 f8 i8 p $result=mail($to,$subject,$body,$hearer); ( j6 |. w$ k4 s. Q! ?7 c
if($result) . \, N; R1 ?% t, d% M! i
echo "邮件已成功发送"; ' C- c( C" b" Y4 ~
}
. S9 \) A& D5 _, t! G ?> 7 _5 q! c+ M M. C/ f
<html>
P- U, P" ^+ j* ^; L <body>
1 G4 o6 ?/ I- P7 ] <table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#6699FF">
6 K: }! b' J7 H% s, n* h <form method="post">
% l2 `, U2 A3 q2 s9 C3 l <tr bgcolor="#E7E7CB">
# I4 g+ j0 C/ ^5 w. A8 j <td width="20%" height="26">发件人:</td> 4 _* l$ O; | {% H5 F0 U+ J- _
<td width="80%"><input name="from" type="text"></td> 7 B* _; [4 Z2 ^$ H& g% v
</tr> & N0 p( `. [5 t, [
<tr bgcolor="#E7E7CB"> 2 k+ P) H- Z( e/ b: q" o. }" v
<td height="25">收件人:</td>
. T: X O: |" l- {. P8 M' l <td><input name="to" type="text"></td> ; f, o2 ?( Z5 C/ ^
</tr> , O* b2 e; x- R4 ]6 g
<tr bgcolor="#E7E7CB"> ! l7 s. B4 j. |! m- S# K* |
<td height="24">邮件标题:</td> " D; L8 r$ L6 ]2 K% B4 z5 d, ?
<td><input name="subject" type="text" size="50"></td> ! T' d5 y0 Q. a; |, P% n+ V' z
</tr> # V: V7 F! S0 M4 M
<tr bgcolor="#E7E7CB">
) W) F2 ]5 d' K- \1 J; U. U <td height="27">邮件内容:</td>
/ c# L$ o! s/ h& P! `# ?3 I5 ^# [ <td><textarea name="body" cols="60" rows="10"></textarea></td> / D1 R6 @5 f3 V+ X
</tr>
5 Y3 a* i% ]. ~2 o8 Y* o2 g- J <tr bgcolor="#E7E7CB">
6 L. y0 z$ I; } <td height="28"> </td>
1 \ s: k. Z( G$ ~- |/ _% V <td> & {/ Z4 x& ` p% M& P, q1 t) v
<input type="hidden" value="1" name="send"> ! c+ O7 i+ e+ O3 I% n0 U+ e
<input type="submit" name="Submit" value="提交"> ? B* ^$ a( O* h" U& n6 n, u
<input type="reset" name="Submit2" value="重置"></td> 3 v; [& Y" ?1 q9 p& ]$ h; b3 f5 q
</tr> 6 v6 ^" ?1 u) _% Y
</form> 4 F; X' M5 n3 S1 P% Q
</table> 9 ]* |6 ?& n6 ?5 L+ X
</body>
5 x1 b+ E4 `7 |8 }7 D: L" `/ l% d$ [ </html>
5 ~3 G# Q$ H6 n % t! N9 c5 O/ p
-------------------------------------------------------------------------------- " ^) T! f7 K1 A+ r7 W: H/ r$ `
时代互联 (www.now.net.cn/host) 的PHP 虚拟主机性能: 2 T. l# A/ y9 f. a
9 S, `; U" `) j# d
PHP4.3.6 GD2.1x mhash iconv 支持Zend 加速及加密 XML kerberos IMAP ZLIB CURL 3 { X8 }, A9 B j
Apache2 PHP 内核整合 MySQL4.0.17 带phpMyAdmin 管理后台 支持网站访问统计 4 Q) y& I7 p: e {* o
: d9 g0 N- c. m8 J
★送免费的留言板和计数器 ,流量访问系统
5 f. q2 @- m! F( s / I; E9 e3 y* _6 y. ]( |6 j
推荐类型: ; f: A) p- q7 w b7 @
$ y i3 D& c( r g5 r* g 商务型B+.CN域名 送800M 空间邮箱 1300元/年 - s$ G% f" k% Y# V2 N4 u
点击: http://now.net.cn/host/commerce.net?PHPSESSID=aca5c80915ad9bcc097e352cf57e9d61
4 U6 A9 p' @4 S+ n- Q* g 虚拟专用型B+.CN域名+国际顶级域名 送2000M VIP 企业邮局 配置MYSQL数据库 3800元/年
" N* Y/ I" ]0 m; h [: Z6 N8 x6 y+ i
: I3 z. e2 Q6 s+ J7 x 订购地址:
) ]7 l, W% `7 k' i http://now.net.cn/host/vps.net?PHPSESSID=aca5c80915ad9bcc097e352cf57e9d61
0 `+ b- m7 B+ t -------------------------------------------------------------------------------
0 ]/ L7 [; j, P4 p" d& Q 虚拟主机的优势: http://now.net.cn/news/MessView.net?IDMessage=4607
! L6 ?7 C" T9 _7 O 全球免费咨询电话,请点击 http://www.now.net.cn/customer/moreline.net ! d, \8 i: u5 i3 W0 ^7 \
Q Q在线咨询:188092185 108786612 - K: N7 p0 R! W/ J/ j
TEL:0756-3813159 3813160 |