|
** 用PHP 发邮件例程 ,欢迎参考 ** & ~0 x5 x3 G; a& w
) v R9 i# E7 }/ L6 h' e! m0 y 目前我采用的空间是PHP+MYSQL类型的,有关于PHP方面的编程问题,欢迎一起讨论
3 m/ ?% |3 F" l; v/ x6 l 我写了一段PHP邮件例程也在下面,供参考: 8 L# v$ j# J; }' t
/ O! i" w+ H3 J& F 例程如下: ) m+ m) |9 O- K# i
<?
; t4 Z; [+ Z. b |# r if($send){
: f# y3 L; L- v# |+ M; X $hearer="From from\nReply-T$from\nX-Mailer: PHP/".phpversion()."\nContent-Type:text/html"; - s7 f% s8 w) p8 s& q
$result=mail($to,$subject,$body,$hearer); ! X" v9 N0 w7 Q0 i
if($result) ; h7 q0 W w8 K* Z7 P7 m& x4 K
echo "邮件已成功发送"; 6 Q0 g2 g# d/ B0 W( E
}
# w4 [! Y/ o) e, F. I ?> , i" ^" H+ g+ j9 b. x
<html> 5 s- { a7 ~2 i. q, x+ T. d
<body> " I$ z9 t* S1 X+ d3 w
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#6699FF"> : f" p; }5 a/ b& ^) a
<form method="post"> & e$ [$ B G7 L/ a9 b r7 B" Z
<tr bgcolor="#E7E7CB"> 1 K) I2 X3 j0 `( m+ [/ ], ]
<td width="20%" height="26">发件人:</td>
% [1 t$ o. y! @ <td width="80%"><input name="from" type="text"></td> 1 P" H* ?6 s1 i$ l K3 ?9 a. W# ?: R% W2 Z
</tr> " L! ^) {- ?) H( q% k
<tr bgcolor="#E7E7CB">
+ w! B) O7 e1 c0 R( ]. c <td height="25">收件人:</td> " A2 b8 X J3 |$ N/ t* R
<td><input name="to" type="text"></td> " h- m; K- y' n p; a
</tr> * m: w1 n: p8 `% q8 S
<tr bgcolor="#E7E7CB"> ( o8 I' b! x/ s z! E
<td height="24">邮件标题:</td> 1 b3 E9 o' }% W0 }! j
<td><input name="subject" type="text" size="50"></td>
+ K( j3 W0 _* d% W- c' o </tr> & b" K, r- b2 f, t4 K- \
<tr bgcolor="#E7E7CB">
- ]1 m* P. Z. i3 h6 K <td height="27">邮件内容:</td>
; H. R1 U- ?( r- m- q- a6 [; v <td><textarea name="body" cols="60" rows="10"></textarea></td> 8 v0 M& _6 A! e) D* ~
</tr> ! @' u3 q6 i$ m
<tr bgcolor="#E7E7CB">
9 s' |/ J" E) ?. Z' j% `0 O) c9 Y <td height="28"> </td> : v! f, `$ E N% y' s; k3 O
<td> $ b( u/ X& C; _4 j
<input type="hidden" value="1" name="send"> 8 Q8 W6 s! T [9 W5 ?" D. k# |! M
<input type="submit" name="Submit" value="提交"> 9 p, Y$ s& S4 L5 L/ _8 j, i# w- v D
<input type="reset" name="Submit2" value="重置"></td>
6 U Y7 V8 G6 A, [% s4 V0 S </tr> ! H3 h) T& H6 E1 U
</form> . M/ F1 r9 i4 D5 q) _4 }( \: J/ q" x
</table> 4 V& s ~ k* X8 S
</body> 3 v4 `4 x6 Q: f; h4 h
</html>
* [/ f- n- J$ Y2 i/ |, t: V8 i
D3 x) v# I# R+ }, S6 t -------------------------------------------------------------------------------- 4 X. J, m# Q# J+ o& Y6 J1 N
时代互联 (www.now.net.cn/host) 的PHP 虚拟主机性能: " d/ o; a9 Z' h) ?
+ L+ p1 D7 M& ^, A PHP4.3.6 GD2.1x mhash iconv 支持Zend 加速及加密 XML kerberos IMAP ZLIB CURL & W P% v6 s; g2 u
Apache2 PHP 内核整合 MySQL4.0.17 带phpMyAdmin 管理后台 支持网站访问统计
% G6 A$ \2 B4 [( A 8 P& a! h0 h2 K3 k: M( Y
★送免费的留言板和计数器 ,流量访问系统 4 q$ ^# k9 e' X! k: W0 f
! V- c+ O9 J" e9 {0 H+ A9 p0 f8 E 推荐类型:
9 e2 @5 t3 B4 i) W9 f8 X( B
7 s, _- R! J# y/ R( w 商务型B+.CN域名 送800M 空间邮箱 1300元/年 & X+ J) B/ z/ F6 {
点击: http://now.net.cn/host/commerce.net?PHPSESSID=aca5c80915ad9bcc097e352cf57e9d61 / u* b1 o+ L) C: m& |! a
虚拟专用型B+.CN域名+国际顶级域名 送2000M VIP 企业邮局 配置MYSQL数据库 3800元/年
! d2 A/ K" B l! C8 G* W 2 `5 a: F' J+ b# S& f
订购地址:" V7 r' M+ r4 q; E/ I2 @ B5 ?
http://now.net.cn/host/vps.net?PHPSESSID=aca5c80915ad9bcc097e352cf57e9d61
# x4 v" ^; u! ~" N: z+ \ -------------------------------------------------------------------------------
; C8 C0 d4 L4 c( l; V 虚拟主机的优势: http://now.net.cn/news/MessView.net?IDMessage=4607
) Q; d5 F5 {, b F& M 全球免费咨询电话,请点击 http://www.now.net.cn/customer/moreline.net 8 i6 \1 [0 O3 h
Q Q在线咨询:188092185 108786612
3 i5 D3 H; W [. E3 ? TEL:0756-3813159 3813160 |