|
** 用PHP 发邮件例程 ,欢迎参考 ** , U- x8 } X* t4 T* R
D* _& L* M) l4 {( Y- [% X& G, U- j
目前我采用的空间是PHP+MYSQL类型的,有关于PHP方面的编程问题,欢迎一起讨论 ; G4 m7 [! c- l# H. }
我写了一段PHP邮件例程也在下面,供参考:
1 x; Z& z. V$ d" K7 W# ^& ~ " ~$ W5 O8 b/ @& }3 P
例程如下: 0 i1 I# l4 q# S+ t6 M
<?
, i, G7 s5 t# }' |- y4 @# N# z" ^ if($send){
$ H( f0 C% f. b% P% u $hearer="From from\nReply-T$from\nX-Mailer: PHP/".phpversion()."\nContent-Type:text/html"; - V: j% ^# h7 u8 c0 h& P
$result=mail($to,$subject,$body,$hearer); ' E3 ^2 T% Q @
if($result) 1 p6 M8 k# d8 i/ x; q9 h2 f
echo "邮件已成功发送"; - K3 v' b- f% M7 B% i4 j
} 5 W2 f4 n H3 l! Y2 V
?>
* ?/ g I2 p( e/ y. v, C& _ <html>
, ^8 m0 K- M5 K4 V" O; H! X4 K9 n <body> + e# T D9 K7 N5 Z1 Y9 ]) ^6 K
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#6699FF">
$ ~! u- Z! ]' r$ z# G <form method="post">
; j* i: Q0 O* ~/ Y <tr bgcolor="#E7E7CB">
3 g# i7 ?1 }- }7 D <td width="20%" height="26">发件人:</td>
5 [2 b& R0 K' L8 P <td width="80%"><input name="from" type="text"></td>
1 M4 j- i# S& H* z2 t* L </tr> 3 T( ]8 E% @8 Q! O
<tr bgcolor="#E7E7CB"> / r: J& |0 |7 O& Z
<td height="25">收件人:</td> ; b) y% v! K0 b# O) n4 J
<td><input name="to" type="text"></td>
5 w: A6 c, ^2 k& j/ b7 n </tr> 0 D) c& L2 E9 m2 p! \
<tr bgcolor="#E7E7CB">
; a* i% V4 E1 q6 { <td height="24">邮件标题:</td>
' ~9 y8 N+ q( Z+ }0 O0 V8 t <td><input name="subject" type="text" size="50"></td>
4 F; I4 `7 a6 B9 G1 u7 Q </tr> / i- ?* m2 g8 @) n4 f2 U
<tr bgcolor="#E7E7CB"> 2 M+ V x& f" b2 N
<td height="27">邮件内容:</td>
3 F( o, j5 ~) H' i# y+ u <td><textarea name="body" cols="60" rows="10"></textarea></td> 9 }4 _4 E4 x5 I* W( T) y
</tr>
3 B. A( i- g2 @6 y/ D# I+ f0 b* c <tr bgcolor="#E7E7CB">
* y, e/ T7 ~4 H4 Q! u4 R4 ~" x <td height="28"> </td>
( s3 X4 U- R1 @ <td>
/ i- ^5 Q4 f, `7 S. P5 V& U; G <input type="hidden" value="1" name="send">
$ o ~" m& R/ ?, N7 _4 x5 o2 T <input type="submit" name="Submit" value="提交">
0 c; } {7 f- f7 d <input type="reset" name="Submit2" value="重置"></td>
2 y* K3 H( K% C7 z </tr>
" L! N' v% x# K4 T8 i0 c8 T </form> * V' {' _ e7 T
</table>
* e) Q3 ?, I: _ </body> 0 n3 R" f3 O0 i- i% |5 p/ Z5 J
</html> ( g7 U, D/ I, C$ U3 x9 G. U1 n) m
- p# j: P* \8 {+ M9 D -------------------------------------------------------------------------------- ; S9 K0 g) i) G4 i7 @
时代互联 (www.now.net.cn/host) 的PHP 虚拟主机性能:
" B- F& J: S0 n8 n0 X4 `
4 ?! o3 ]0 p o! H PHP4.3.6 GD2.1x mhash iconv 支持Zend 加速及加密 XML kerberos IMAP ZLIB CURL + ] j5 F" [ q% j0 l0 \. E+ B E
Apache2 PHP 内核整合 MySQL4.0.17 带phpMyAdmin 管理后台 支持网站访问统计
, [: O" q- ]2 I5 r ( r- N! h; {) s8 z
★送免费的留言板和计数器 ,流量访问系统
9 M: [- A% l3 P Z: ^( ^ " u9 P/ s; K8 m7 v
推荐类型:
* J* W' E# j7 G# ~0 W) D8 }" \
$ V0 Z3 v9 o% f4 [+ W. | 商务型B+.CN域名 送800M 空间邮箱 1300元/年
$ M( ?; k; l! i ?" G0 O0 t3 W0 t& s 点击: http://now.net.cn/host/commerce.net?PHPSESSID=aca5c80915ad9bcc097e352cf57e9d61 8 N* H1 I6 {; g/ S( k
虚拟专用型B+.CN域名+国际顶级域名 送2000M VIP 企业邮局 配置MYSQL数据库 3800元/年
( y4 ] x( R% S, C/ V: ^1 \- i ! k" T2 d( o. E- t4 G4 s
订购地址:/ c- g8 y8 ]% I( k7 n
http://now.net.cn/host/vps.net?PHPSESSID=aca5c80915ad9bcc097e352cf57e9d61
& J% _3 n- m3 [7 c ------------------------------------------------------------------------------- & O2 F; C" ]* P O7 G) ^2 B: x
虚拟主机的优势: http://now.net.cn/news/MessView.net?IDMessage=4607
4 H* w1 V+ h/ J" h' Z* a3 } 全球免费咨询电话,请点击 http://www.now.net.cn/customer/moreline.net 5 E+ r6 o& R( X
Q Q在线咨询:188092185 108786612
0 B+ e, }# c( D4 \ TEL:0756-3813159 3813160 |