|
** 用PHP 发邮件例程 ,欢迎参考 **
: s$ K! N# q# `$ M: x. J
1 c0 I9 M: F7 G/ ~* X8 g 目前我采用的空间是PHP+MYSQL类型的,有关于PHP方面的编程问题,欢迎一起讨论
& W" G5 [) i6 e; y7 w) P 我写了一段PHP邮件例程也在下面,供参考:
$ w9 r& M" O( Z 4 m& d& v( \4 L& L5 [+ d
例程如下: # o; ~4 r+ M( H- d
<? 2 P# P* w* O4 M4 @1 T
if($send){ , |( m+ g/ H" P3 S7 s' J" c) K2 K
$hearer="From from\nReply-T$from\nX-Mailer: PHP/".phpversion()."\nContent-Type:text/html"; ! C# Q8 y# W! m& k6 W% X' I5 D: m
$result=mail($to,$subject,$body,$hearer);
& _9 N( o" @& w% X2 p1 _ if($result) $ i2 |3 L. q0 o3 K% K' s% K
echo "邮件已成功发送"; 9 A1 Y: Z$ N8 I6 Y4 t1 I& W2 ~
} & i# m7 v! t0 v% }9 e" V: {
?> 6 X7 a+ d- Y' M4 _* X9 s
<html>
. l# E8 N' V3 K# k7 S3 ? <body>
( O( | \7 C+ c& T$ i/ x <table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#6699FF">
" q* i& x, {4 H, M$ n9 w <form method="post"> - s* E& Y6 o" A0 N& J) N- P8 f
<tr bgcolor="#E7E7CB">
, u$ A; a9 ]& O" U- _. o1 W7 ` <td width="20%" height="26">发件人:</td> % F1 E/ X' F5 K( R
<td width="80%"><input name="from" type="text"></td>
# O, ]/ C, M$ g5 ^2 w% U' A* z </tr> - O3 [) Y [, M( Q7 t, ]
<tr bgcolor="#E7E7CB"> 7 ]3 ^2 E0 k3 K7 p. Z9 O" o8 N
<td height="25">收件人:</td>
1 u0 o/ `# y$ {; Z% b* @; z: o& j <td><input name="to" type="text"></td>
" ?& I3 N. h' ^1 ^3 _ </tr>
. ]9 |/ B5 C. `8 v( }2 V <tr bgcolor="#E7E7CB"> ' c4 ^9 G/ G U- t. m" q+ \: u0 e
<td height="24">邮件标题:</td>
) C0 K) E( ^* f3 K <td><input name="subject" type="text" size="50"></td> , K0 Z; k& H) ]1 _+ j1 i4 x( `
</tr>
1 D$ H6 Q: r9 s6 }& q( i! V& D+ ~ <tr bgcolor="#E7E7CB"> " c6 Z+ Y; @2 F) t" G0 N6 `% M
<td height="27">邮件内容:</td>
2 O( T+ J% u5 _8 L <td><textarea name="body" cols="60" rows="10"></textarea></td> + v- h" x/ x. q/ Z8 C5 E
</tr>
- K% X+ M; B6 {9 e+ g j) v( P V <tr bgcolor="#E7E7CB">
7 n1 j; Y" p! J! @ <td height="28"> </td> 0 P' e' ?# y1 o
<td>
& {; f: P/ z* T5 p' I4 a; x <input type="hidden" value="1" name="send"> $ z6 S3 ` r' h/ w- G
<input type="submit" name="Submit" value="提交"> - H) Q$ J8 F! d+ p
<input type="reset" name="Submit2" value="重置"></td>
- q9 |; W' r7 ^9 {* E </tr>
5 ]' Q* K6 I. P5 {+ x: o/ s </form>
0 A6 A+ o3 X( \" R$ E </table> 3 u, Z7 D8 y* V3 y
</body> [" n4 H: v; O' t/ r
</html> 1 C9 {1 D+ n2 S
" q; l, Y) V% L. A# W: P" O+ ]1 W -------------------------------------------------------------------------------- 9 m- p; i" B" U& X% @
时代互联 (www.now.net.cn/host) 的PHP 虚拟主机性能:
" K* K# W; A# ~8 H p. } 3 J2 s% G* U3 J* r5 B
PHP4.3.6 GD2.1x mhash iconv 支持Zend 加速及加密 XML kerberos IMAP ZLIB CURL 7 I6 m4 `4 x3 I: C+ A7 K
Apache2 PHP 内核整合 MySQL4.0.17 带phpMyAdmin 管理后台 支持网站访问统计 . ^; P3 V$ W& h
- v* W5 t+ A$ A# @* {
★送免费的留言板和计数器 ,流量访问系统
/ c+ _( U% O0 P! ]
2 ~8 f1 t" N3 r% Y7 ^; _ 推荐类型: " s7 m3 N _! F
8 l7 y/ X' w% N* m5 q) q, g f' p 商务型B+.CN域名 送800M 空间邮箱 1300元/年 8 q' m& g. r; N+ {# l
点击: http://now.net.cn/host/commerce.net?PHPSESSID=aca5c80915ad9bcc097e352cf57e9d61
& N0 a5 l/ @! D+ H 虚拟专用型B+.CN域名+国际顶级域名 送2000M VIP 企业邮局 配置MYSQL数据库 3800元/年
3 ~/ M6 L' ~ m6 {1 {3 i3 [- n
7 T5 ?/ S9 S4 v- Z' d 订购地址:
* p" M* f$ d ]% m2 C http://now.net.cn/host/vps.net?PHPSESSID=aca5c80915ad9bcc097e352cf57e9d61
% g3 j# b5 z c7 m6 r -------------------------------------------------------------------------------
e6 m0 p* h* S& z" H: l { 虚拟主机的优势: http://now.net.cn/news/MessView.net?IDMessage=4607 , @. w& T" ^3 Z D
全球免费咨询电话,请点击 http://www.now.net.cn/customer/moreline.net
' Y8 N% K5 x( {' c. \- j& F' V Q Q在线咨询:188092185 108786612
5 r+ R7 g. s. c( c' B* [0 R TEL:0756-3813159 3813160 |