|
** 用PHP 发邮件例程 ,欢迎参考 ** ! j$ i5 I& T: r/ C) y* P
B; P. a4 w) H
目前我采用的空间是PHP+MYSQL类型的,有关于PHP方面的编程问题,欢迎一起讨论
}% A0 e5 q% C9 k0 N& V 我写了一段PHP邮件例程也在下面,供参考: 0 h4 z% m! V! K$ Z. U; {+ b& W& U
4 S5 P& c5 j) V$ A, D, A0 Z
例程如下: & o; j5 ~6 y+ O0 j0 ^
<? * K* c2 G8 p3 {( k
if($send){ 6 E* y9 r' O% W: Y0 h* D
$hearer="From from\nReply-T$from\nX-Mailer: PHP/".phpversion()."\nContent-Type:text/html";
' ^ t* ^* w' s/ ~ $result=mail($to,$subject,$body,$hearer);
! F1 N0 Q$ w j9 g- c4 k0 ]- U f if($result)
1 p4 H; e' \/ v; _- g echo "邮件已成功发送";
F0 o2 m# n( b' L9 e [ }
( W2 @3 e- e3 i0 b; O' ? ?> 9 `. \3 [9 ^* N4 I
<html> - \% n4 ]" X, k$ {
<body>
7 {' g1 o6 r, [! k! [, K <table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#6699FF"> 1 j7 Q2 O3 W) Z% O& N
<form method="post"> # L' c2 [0 ~1 y0 A+ n3 Y: e. }) K
<tr bgcolor="#E7E7CB">
. F$ p1 G) C; j8 p) z! E' p <td width="20%" height="26">发件人:</td>
2 m) A2 X" L+ g. I# p, _5 W <td width="80%"><input name="from" type="text"></td> u6 E" B6 h- e4 H2 I+ y4 v; X
</tr> ' P- {, U8 E" N; Z+ Y
<tr bgcolor="#E7E7CB"> & C) q" P8 Q' w! N
<td height="25">收件人:</td> * W; a0 r% G, y' Q
<td><input name="to" type="text"></td>
& o' L X) z5 A* p6 y </tr> : c! H% [0 q3 j' S! C) R" Z7 n* q
<tr bgcolor="#E7E7CB">
; y1 o8 @+ |+ l7 n- q) j5 ? <td height="24">邮件标题:</td>
' A" |0 a) J' S a3 d <td><input name="subject" type="text" size="50"></td> 7 }5 X4 w6 J5 W: }' d
</tr>
! g2 g) ^% g5 D/ \' W- X <tr bgcolor="#E7E7CB">
j/ K+ p4 a( |7 ?% R <td height="27">邮件内容:</td> " P9 ]" d% b7 u9 ?/ h" o- Q% e4 f
<td><textarea name="body" cols="60" rows="10"></textarea></td>
4 Q) m( S: t2 n2 V9 {; Z </tr> 6 E9 T- E4 L- W1 `& W1 c' l7 T9 w9 F
<tr bgcolor="#E7E7CB"> 5 a6 S5 r/ u$ |4 U! ?6 T
<td height="28"> </td>
. P4 p X9 a: m+ c* r7 t <td> / {( [, E2 H+ `& o8 F" c' D
<input type="hidden" value="1" name="send">
' Q' o2 v% ^+ T/ W( Q <input type="submit" name="Submit" value="提交"> ) \- @8 k+ s9 [
<input type="reset" name="Submit2" value="重置"></td> ! ~* Y& |2 J u
</tr> ) ?1 J7 R% X! O
</form>
1 X3 V+ Y8 f3 t* ` </table> 8 |/ `9 H! [# C4 [
</body>
+ ^, _1 J8 q' i/ V' F8 I" q; D& J9 J </html>
' m, `5 I" b) g- e) }5 i6 T/ w 1 M, p- m1 v7 Q3 \2 C1 x W/ b
--------------------------------------------------------------------------------
# z7 y9 Y7 h! O 时代互联 (www.now.net.cn/host) 的PHP 虚拟主机性能:
9 ]+ M4 w2 y; i6 f# m
( h0 s2 B$ b F& u+ C PHP4.3.6 GD2.1x mhash iconv 支持Zend 加速及加密 XML kerberos IMAP ZLIB CURL
8 r" |! f/ w* ]1 r: N! c" u Apache2 PHP 内核整合 MySQL4.0.17 带phpMyAdmin 管理后台 支持网站访问统计
8 {" t2 y# @5 k4 B7 U/ {/ D( w 1 V3 E7 u/ K0 y8 B9 O7 h
★送免费的留言板和计数器 ,流量访问系统 7 Z w% D, D& W2 D' g9 A2 n* H
" J, `) R P4 r% d" }* O
推荐类型:
8 @& R5 P) r) N/ v1 O, T, U 5 Y C: @; E# N X8 g# `
商务型B+.CN域名 送800M 空间邮箱 1300元/年 7 ^& i# Z& w# \. m; K) D
点击: http://now.net.cn/host/commerce.net?PHPSESSID=aca5c80915ad9bcc097e352cf57e9d61 2 q: D3 ?- a3 Y5 H$ f
虚拟专用型B+.CN域名+国际顶级域名 送2000M VIP 企业邮局 配置MYSQL数据库 3800元/年
# @/ Z+ }# m( g4 h0 n" ?) k0 k
+ m$ h; H4 b# M* s% G 订购地址:. }1 d# ]" ~" v% f0 z
http://now.net.cn/host/vps.net?PHPSESSID=aca5c80915ad9bcc097e352cf57e9d61
9 o S( _: W3 J; F ------------------------------------------------------------------------------- 8 E; s) @& M1 s# l8 q% X
虚拟主机的优势: http://now.net.cn/news/MessView.net?IDMessage=4607
' O. h7 j. F" q1 s5 L# d 全球免费咨询电话,请点击 http://www.now.net.cn/customer/moreline.net $ X w4 C' B N
Q Q在线咨询:188092185 108786612 5 _* f# e. s6 X
TEL:0756-3813159 3813160 |