|
** 用PHP 发邮件例程 ,欢迎参考 **
( `# U$ ]% ?* m8 S# y # r: p* U7 B! f+ y( M, c3 @
目前我采用的空间是PHP+MYSQL类型的,有关于PHP方面的编程问题,欢迎一起讨论 $ _5 Z4 {# l2 C- z
我写了一段PHP邮件例程也在下面,供参考:
" h$ q1 X5 a7 [6 E
+ ]" }8 _0 Z+ G. m 例程如下:
) |* U& T/ K. a! c, w; u2 t <?
# e- p0 y! S' Q% h5 K6 M5 A if($send){ + G R5 [ d, Y
$hearer="From from\nReply-T$from\nX-Mailer: PHP/".phpversion()."\nContent-Type:text/html"; & I7 j2 u7 v) j6 P* a% z
$result=mail($to,$subject,$body,$hearer); * ~; a$ V$ |: \
if($result) ' r* X6 G4 ^2 r6 T) X, K+ d* \
echo "邮件已成功发送"; & D p8 @2 \% Z- I% O* E
}
2 |" L: |9 o& f; ]7 Q0 N ?> 5 d/ J& q& v9 ~' U
<html>
) Z& M5 j# q: n! n9 e' B" D# b <body>
! h+ p& K: u* f x0 p/ z" } <table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#6699FF">
# N. ^8 f+ I5 A6 u <form method="post"> . z3 ` w P5 j7 B. h
<tr bgcolor="#E7E7CB"> * C$ e5 X1 u( i- k0 E# y4 X+ d! a
<td width="20%" height="26">发件人:</td>
. ?" a* Y7 [6 p8 G) v <td width="80%"><input name="from" type="text"></td>
( B% L9 k7 L6 ? </tr>
S3 f5 d+ ^6 S' A' \" R <tr bgcolor="#E7E7CB"> 0 |" P6 ^5 `) R9 D- G) S
<td height="25">收件人:</td> % n1 V. |$ V. S
<td><input name="to" type="text"></td>
) E& N T# a! g. J: } </tr> ; T$ K H' l2 W/ b9 G
<tr bgcolor="#E7E7CB">
: W: ?) W1 [/ q$ d) j. ] <td height="24">邮件标题:</td>
1 ?$ M) j) L1 @5 S <td><input name="subject" type="text" size="50"></td> : c \! G- \0 ] \
</tr> C# [6 J$ C0 i6 K# S8 C e& C
<tr bgcolor="#E7E7CB"> ( \! R$ y' i6 I- P+ W" m* T) C j# H
<td height="27">邮件内容:</td>
0 J5 O6 e0 [2 t: l/ G <td><textarea name="body" cols="60" rows="10"></textarea></td> " S6 }3 K( _2 ] L" O
</tr>
& {" e8 c4 x- U! Q# E" r" f! P <tr bgcolor="#E7E7CB">
) W& R% S# @' Q. P$ X. h3 ? <td height="28"> </td> ' X- G, F1 y+ s( ~8 v7 k
<td>
7 U# [% ~6 m6 Z+ T0 l <input type="hidden" value="1" name="send">
& y' Z9 o" ]/ P2 r9 ]6 W <input type="submit" name="Submit" value="提交"> 7 G9 t+ _! X$ W1 G# m$ }
<input type="reset" name="Submit2" value="重置"></td>
. c2 x4 h& T; e* f9 e0 M+ A </tr> 6 z( l" _% L; n! n" w
</form> 0 L W" [- F7 h/ Q! s
</table>
9 T0 ^: I% T+ j/ N) C </body>
# O% [9 j1 I" K, f/ v1 H </html> 2 f3 i: A( P& R' S+ }- K9 }2 W
- ^6 d/ C: m* C: J; {" y4 [
-------------------------------------------------------------------------------- : R( ~7 v+ ~# W( A' q
时代互联 (www.now.net.cn/host) 的PHP 虚拟主机性能: 8 _. R) h2 g. @" \5 O9 T
) q7 F/ Y+ d: ]/ U: A) f
PHP4.3.6 GD2.1x mhash iconv 支持Zend 加速及加密 XML kerberos IMAP ZLIB CURL # z: q+ X' b* W3 @: M j
Apache2 PHP 内核整合 MySQL4.0.17 带phpMyAdmin 管理后台 支持网站访问统计
! V* l8 J- z4 a* y8 A/ u4 Z" D . ~1 R) O% S" A. }# U
★送免费的留言板和计数器 ,流量访问系统
q' e1 ] n3 I" q $ k# ~7 q9 ^$ \8 d/ `( H
推荐类型: / P2 v! l' t! y- S: x8 L2 S6 @1 h0 V
8 [+ u! x8 S; ^, Z7 S# ~4 k 商务型B+.CN域名 送800M 空间邮箱 1300元/年
9 @0 }% }" |% k* f 点击: http://now.net.cn/host/commerce.net?PHPSESSID=aca5c80915ad9bcc097e352cf57e9d61
8 j, \, q1 G b. j I0 t( g$ O4 t 虚拟专用型B+.CN域名+国际顶级域名 送2000M VIP 企业邮局 配置MYSQL数据库 3800元/年
! P& m7 D' C) N, `+ O6 \ + }# j+ V: R4 g
订购地址:4 x. m0 F9 l* h; R) w+ y0 ^1 |
http://now.net.cn/host/vps.net?PHPSESSID=aca5c80915ad9bcc097e352cf57e9d61( j! X1 b* _5 v2 B
------------------------------------------------------------------------------- - m c" g' y7 |7 C+ U
虚拟主机的优势: http://now.net.cn/news/MessView.net?IDMessage=4607 " P0 x M. [6 b' x h8 f
全球免费咨询电话,请点击 http://www.now.net.cn/customer/moreline.net
' f c7 m$ I G6 `+ u Q Q在线咨询:188092185 108786612 : F2 n7 e# J* [
TEL:0756-3813159 3813160 |