|
** 用PHP 发邮件例程 ,欢迎参考 ** 7 R/ v( |( ?5 Z+ N4 A* ~9 L
5 }" Q6 u( t4 p 目前我采用的空间是PHP+MYSQL类型的,有关于PHP方面的编程问题,欢迎一起讨论 ; j/ M6 R+ A, s1 p4 X
我写了一段PHP邮件例程也在下面,供参考:
5 A+ ?# Z( ?( | ( p% {: D' \! z9 y
例程如下: 0 u+ l( v1 X4 Z2 g( ~0 L! i( U$ C
<?
& H U# ^( G' B" B- c+ ] if($send){
: k7 m3 L' o5 _2 _! `! h! {$ o& e $hearer="From from\nReply-T$from\nX-Mailer: PHP/".phpversion()."\nContent-Type:text/html"; ' \) n' V# @( q; M9 T
$result=mail($to,$subject,$body,$hearer); % l( ?" I8 T. b; r6 b
if($result)
3 S( S0 |) V( b. O! b8 x- R/ u% i echo "邮件已成功发送"; : S5 Y- C( H- G$ J1 a. t- m7 ?
} 8 d5 ?- N. S" E. y$ Q3 n
?> + @3 }# ~7 @% e- R8 S/ _7 X) h5 y
<html>
+ Z& X" d$ f% A- J+ {6 [ <body>
7 z# B. K6 W, Z! k1 ]& O <table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#6699FF"> 0 Y" q" P$ Z4 Q2 ?1 F$ b# w) f
<form method="post">
1 D% a) }: j" m3 V5 n+ h* [: `- p) j <tr bgcolor="#E7E7CB">
& d6 [. h% b3 W3 e ^ C% B- r <td width="20%" height="26">发件人:</td>
- F! s& }; U( D& N# r <td width="80%"><input name="from" type="text"></td> ' ~9 T$ T0 d' ]3 T) d
</tr>
Y. H' F$ p6 p5 @' A6 Z <tr bgcolor="#E7E7CB"> ( \7 S0 J1 |5 h3 A& b# r0 m
<td height="25">收件人:</td>
" A" R" L: J+ | <td><input name="to" type="text"></td>
$ W- g" V v( T( a </tr>
) E; c3 t8 u% t- f( D K <tr bgcolor="#E7E7CB">
4 a# B b, _4 M( c% [' J <td height="24">邮件标题:</td> ; ~1 n e; U* z9 j& X
<td><input name="subject" type="text" size="50"></td> 9 i; k5 `1 ~; f0 f P. M* ?6 a
</tr> * g) r* F) r# T x0 |' Z6 @0 D
<tr bgcolor="#E7E7CB"> r. ?* o, \$ e- f3 K/ G6 Z$ w: t
<td height="27">邮件内容:</td>
) d" E0 m# U3 V$ q* k% N <td><textarea name="body" cols="60" rows="10"></textarea></td>
; s7 i# N- h! R5 d </tr>
! A5 W& P4 Q5 R i% T; J& h <tr bgcolor="#E7E7CB">
9 ^" F; q$ `) [% o( g+ A <td height="28"> </td>
# N- V1 E9 u/ R! X <td>
t2 y2 h7 C* i8 l. M" W% ~: I <input type="hidden" value="1" name="send"> 0 ^# D! L) Y" `9 m3 ]2 H
<input type="submit" name="Submit" value="提交"> 3 E3 `4 d, X# \6 n+ j3 Y
<input type="reset" name="Submit2" value="重置"></td>
3 [' ^0 y4 ^) S) ` </tr>
4 L2 C0 W8 K9 o9 ` </form> 9 L8 F8 B& b) d) i/ E, E
</table>
$ @# C5 g5 K& }1 W) R8 E0 U </body>
- @( t% ?) h8 n8 e </html>
$ e! Z; V8 X2 A
: z; }% G6 _1 E6 @ -------------------------------------------------------------------------------- : i- U' v; S3 B6 I; a2 {
时代互联 (www.now.net.cn/host) 的PHP 虚拟主机性能: / ~% b/ c3 `( n! D( P( U
3 x& q7 K+ e; ]- h: m
PHP4.3.6 GD2.1x mhash iconv 支持Zend 加速及加密 XML kerberos IMAP ZLIB CURL
# X) X4 r3 m4 v2 e' K/ U2 r Apache2 PHP 内核整合 MySQL4.0.17 带phpMyAdmin 管理后台 支持网站访问统计
$ |0 B$ C5 ^5 [( `7 z( [5 @7 c ) @8 h0 Z: w: N: a
★送免费的留言板和计数器 ,流量访问系统 & s; S5 N( s3 P+ W3 x7 d/ T. D
% |: [; @0 H1 \& A9 Y. a 推荐类型:
$ i/ H& j# a S8 n; d# K J; [5 }5 x
; b8 \) E# z$ `8 Q0 |" t7 C/ |1 b 商务型B+.CN域名 送800M 空间邮箱 1300元/年 0 T6 X) X5 \' q ~3 e
点击: http://now.net.cn/host/commerce.net?PHPSESSID=aca5c80915ad9bcc097e352cf57e9d61 8 c, X9 O! S; l# n
虚拟专用型B+.CN域名+国际顶级域名 送2000M VIP 企业邮局 配置MYSQL数据库 3800元/年 9 U. i3 J7 g1 X; j
6 _; B# b, ~& |8 S 订购地址:8 c6 }6 j/ x" o) V4 i
http://now.net.cn/host/vps.net?PHPSESSID=aca5c80915ad9bcc097e352cf57e9d61; y9 g6 B# h6 c8 G8 i' b# F
------------------------------------------------------------------------------- 6 D& z8 y2 n& O
虚拟主机的优势: http://now.net.cn/news/MessView.net?IDMessage=4607 8 J3 O, T, ~- s$ Z
全球免费咨询电话,请点击 http://www.now.net.cn/customer/moreline.net
0 S/ J% T: P% ? Q Q在线咨询:188092185 108786612
/ k1 _' u, N' q6 s% l TEL:0756-3813159 3813160 |