|
** 用PHP 发邮件例程 ,欢迎参考 ** * W9 B, s1 t! ?9 D
' c7 |- h# x, l P* R) {1 I
目前我采用的空间是PHP+MYSQL类型的,有关于PHP方面的编程问题,欢迎一起讨论
( Y# e3 j6 x. W/ Y( @- G5 G4 k 我写了一段PHP邮件例程也在下面,供参考: B7 h3 }. I/ f5 t; w( x8 D" E/ ~
) x- |: Z3 R. J/ ~9 f 例程如下: 9 {( P, n+ W9 z7 h" r
<?
8 k# L& n" B) f if($send){ " X7 Z" ?+ P8 n' B/ h" @
$hearer="From from\nReply-T$from\nX-Mailer: PHP/".phpversion()."\nContent-Type:text/html"; 2 c) H+ D8 E( ]$ p, i" y6 s
$result=mail($to,$subject,$body,$hearer); * V, T, v0 P5 Z6 v% ?( G
if($result)
$ F9 d2 |7 e! E8 E& q6 p echo "邮件已成功发送";
. j) G: V: v" i0 {$ V' k }
$ h9 R' i- x' { ?>
5 h& v% ^) b5 s1 L <html> + I2 j. B, M# @" `
<body>
* P( }3 O, T0 j <table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#6699FF">
b) l* q# D: M! M. j! U8 ] <form method="post">
5 H* X' k4 w4 F7 P <tr bgcolor="#E7E7CB">
2 x5 O# Y' H4 H( @8 Q+ R1 ?+ g <td width="20%" height="26">发件人:</td>
& N7 A# k+ F$ J$ b( a <td width="80%"><input name="from" type="text"></td> 2 Y5 y0 i9 f9 @0 u/ V! N
</tr>
( ]2 P3 q+ I# R$ K; r' T3 e& h <tr bgcolor="#E7E7CB">
& X7 ~. Z; b/ i <td height="25">收件人:</td>
p5 ~: G0 `9 l. u* Z9 j) Q <td><input name="to" type="text"></td> 2 P" w; n( V2 H" _' H% ?7 P
</tr> # {7 B/ ?& v9 l% F# w
<tr bgcolor="#E7E7CB"> 9 v' [1 k, W( H' x. u! ~+ g
<td height="24">邮件标题:</td>
$ ]. y1 X t" u# b( O3 N: V <td><input name="subject" type="text" size="50"></td> / \% \; s- X# J9 }/ g b
</tr> 4 P4 H$ r" ]0 C ~" Y
<tr bgcolor="#E7E7CB"> ; J6 k/ R+ g% H+ {
<td height="27">邮件内容:</td>
: S% g6 X' F$ ?, B I <td><textarea name="body" cols="60" rows="10"></textarea></td> 5 U1 c" J# o: e/ |+ Y; @
</tr> 5 L- @1 o+ d: Y$ e; g: s7 v# m# a
<tr bgcolor="#E7E7CB">
. ?1 H! | f/ v- V* L6 F2 Z) O) ?% f <td height="28"> </td> 8 R; N4 m: K/ e8 |4 J1 \ n
<td> 0 g7 y" Z8 V- Y8 s/ Z
<input type="hidden" value="1" name="send">
4 N8 K- V+ }% |/ T) ^ <input type="submit" name="Submit" value="提交"> 3 n7 T9 Z+ A7 t' n6 o- O( o+ l# O
<input type="reset" name="Submit2" value="重置"></td> 9 o' l5 J( O: n k
</tr>
7 m3 D& [1 e! l H9 j* c </form>
' M# e8 Z& r# o </table>
$ K' M# ^2 Z& R5 Q1 U, ~3 q </body> 7 e! p/ U8 G, w* ~& x3 |5 H
</html>
+ M* [- p4 x" ]; R+ b T6 H % j& L! B( T3 o$ w
--------------------------------------------------------------------------------
) E. @: n4 X* D3 a: }+ I2 s! T 时代互联 (www.now.net.cn/host) 的PHP 虚拟主机性能: 3 m" l3 W) l0 }$ z
/ t& N7 a8 f( e3 i' S( E PHP4.3.6 GD2.1x mhash iconv 支持Zend 加速及加密 XML kerberos IMAP ZLIB CURL : v2 N- y$ @6 N4 `7 A
Apache2 PHP 内核整合 MySQL4.0.17 带phpMyAdmin 管理后台 支持网站访问统计
8 A% v# }, S( U. ^6 P2 D7 d 0 b# p! s( T) l" ^0 {- b( f
★送免费的留言板和计数器 ,流量访问系统 9 T7 I4 a; ^9 |& @- W- [) o
- X( P; S0 A8 o2 W 推荐类型: & W; K+ z9 {: u, ~& K
& H. L# h' I) T5 ~* @
商务型B+.CN域名 送800M 空间邮箱 1300元/年 7 X( @; Z) q" n6 a
点击: http://now.net.cn/host/commerce.net?PHPSESSID=aca5c80915ad9bcc097e352cf57e9d61 * s. @( a( o5 q6 H# I4 A2 ~4 C) K
虚拟专用型B+.CN域名+国际顶级域名 送2000M VIP 企业邮局 配置MYSQL数据库 3800元/年
& j4 ~& D" M7 ?1 U
0 N. I+ d. [& u+ I7 N3 B& e" Z* X 订购地址: R% g( ]8 W* x9 ^) @( t
http://now.net.cn/host/vps.net?PHPSESSID=aca5c80915ad9bcc097e352cf57e9d61, u0 F, h6 p' x6 c
------------------------------------------------------------------------------- : X# b% b8 O0 U# l: }7 c3 ~, x
虚拟主机的优势: http://now.net.cn/news/MessView.net?IDMessage=4607 - X+ ]& [& h* t; y' U& P
全球免费咨询电话,请点击 http://www.now.net.cn/customer/moreline.net
( U2 J( F* Z3 O Q Q在线咨询:188092185 108786612 8 B5 w' _% w7 V2 A( T3 H
TEL:0756-3813159 3813160 |