|
** 用PHP 发邮件例程 ,欢迎参考 ** 2 {/ x# G. o+ O0 P- V2 ]7 s
9 a- O2 ]; H6 S/ q' [3 Z 目前我采用的空间是PHP+MYSQL类型的,有关于PHP方面的编程问题,欢迎一起讨论 1 Q( I- [4 R! M' y Q9 a
我写了一段PHP邮件例程也在下面,供参考: ( l5 N. @' L3 ]' D, ?0 @
+ p% @; S5 H% Q, ~
例程如下: % h+ Z1 n3 x& M5 ?- `1 k6 C( r! d9 |
<?
$ S6 C ~# ]/ y0 b9 N, F; E% D if($send){ 1 L4 v& H7 Z. B! t; W3 F
$hearer="From from\nReply-T$from\nX-Mailer: PHP/".phpversion()."\nContent-Type:text/html";
8 L, @$ i) |7 _" f0 ^( \ $result=mail($to,$subject,$body,$hearer); 5 C# V% ~1 o; h; X7 J
if($result) + x- ~; \( M5 ^
echo "邮件已成功发送"; % _" D, j2 o; @* m
} . t' I* ]* k# t
?>
% { a, h: ?3 k1 S2 Q <html> # o+ ^8 A0 H" Z
<body>
& y `0 N" V0 s8 A, P9 J <table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#6699FF">
3 H& f, d. _, L5 a! B3 ^ <form method="post"> 1 p/ K) `/ g6 k# `
<tr bgcolor="#E7E7CB">
, Q" G4 h, M; p, d5 P8 J <td width="20%" height="26">发件人:</td>
6 X* E" ]2 @: q$ q6 ^4 _6 h S <td width="80%"><input name="from" type="text"></td>
% ]5 Z5 L: {( }4 r/ b: Q </tr> ( q% L! W8 y; X5 L' T
<tr bgcolor="#E7E7CB"> ( g/ I' \# T8 m" e& }
<td height="25">收件人:</td> ; R; T% S4 A: v* [6 t8 p7 s( O
<td><input name="to" type="text"></td> & g7 | v) m4 _# @3 r- B( G' l
</tr> 6 {" B7 A; n* e0 U% O) \/ H& @
<tr bgcolor="#E7E7CB">
! E' V. F8 L" T; e5 L7 j$ c5 h J <td height="24">邮件标题:</td> ( f9 @! K; L4 S. `
<td><input name="subject" type="text" size="50"></td> 0 c& T; K6 c( [6 {3 z/ ?! i& {
</tr>
( b+ y/ d0 @( R' E <tr bgcolor="#E7E7CB">
* E g- u5 e+ y <td height="27">邮件内容:</td> 4 |7 P; X6 f. }
<td><textarea name="body" cols="60" rows="10"></textarea></td>
: f, z& a- I: d c( B9 A) N </tr> ; R- e y6 ^5 t5 b- k" r
<tr bgcolor="#E7E7CB"> ( p- l* N3 {7 e- p
<td height="28"> </td>
- a/ k: R) B L2 o4 | <td>
7 @4 C, ^$ Q6 [# |/ E( H <input type="hidden" value="1" name="send">
. i0 i8 H. _$ u' Z& O; J1 _! C6 O <input type="submit" name="Submit" value="提交"> " T. o9 p1 h. i
<input type="reset" name="Submit2" value="重置"></td> 4 i% i8 E U4 E0 }
</tr>
: V* f6 v7 v, ^6 o3 P% U+ J </form>
4 f/ [9 L1 d2 ]+ Y </table> & h* k; W( c; e% `
</body> # S. D1 P1 l% l. s, P ] g: Q* x
</html> " {; g, s- n* r2 W. A& B2 W
( R& w) D7 ^ O2 P+ h7 ~' o5 m -------------------------------------------------------------------------------- 6 Z" \& u, e2 N! J. r5 j1 L+ M( L
时代互联 (www.now.net.cn/host) 的PHP 虚拟主机性能: 8 T$ T' h' D7 g7 I& z9 L5 O
& H7 f) U6 R- }
PHP4.3.6 GD2.1x mhash iconv 支持Zend 加速及加密 XML kerberos IMAP ZLIB CURL 5 G3 N+ i+ L+ ?% R6 |9 V
Apache2 PHP 内核整合 MySQL4.0.17 带phpMyAdmin 管理后台 支持网站访问统计 4 }% S. d$ I: E3 ~2 [/ g
3 A% V) L) m9 w% T5 ]3 n0 [3 ~ ★送免费的留言板和计数器 ,流量访问系统
1 _. p. o/ C' @: L1 B( P 0 y$ S' j# v0 [- S7 v. ~, g) x6 `/ d
推荐类型: 4 `' V7 V) P; Z- F* I
r: W7 q1 s& a, K 商务型B+.CN域名 送800M 空间邮箱 1300元/年 5 w2 c9 l& I# e& K* b6 k: o
点击: http://now.net.cn/host/commerce.net?PHPSESSID=aca5c80915ad9bcc097e352cf57e9d61 % u, P' X T1 z! ]4 j; W
虚拟专用型B+.CN域名+国际顶级域名 送2000M VIP 企业邮局 配置MYSQL数据库 3800元/年
8 Y+ K" q8 \' i9 ? 5 N* q7 [8 y( h% Y& ~+ B
订购地址:
% {1 T S3 g N1 |6 y" k* U& z! y http://now.net.cn/host/vps.net?PHPSESSID=aca5c80915ad9bcc097e352cf57e9d61
! X% R7 n5 X! t, P9 c) E ------------------------------------------------------------------------------- 4 a3 y3 ?6 Z" l/ |
虚拟主机的优势: http://now.net.cn/news/MessView.net?IDMessage=4607
8 H U8 v5 U, v6 s1 J" i 全球免费咨询电话,请点击 http://www.now.net.cn/customer/moreline.net
1 q* s8 e9 M: F( Q: q& V ^ Q Q在线咨询:188092185 108786612
: R( S, _5 t2 o3 M* Y TEL:0756-3813159 3813160 |