|
** 用PHP 发邮件例程 ,欢迎参考 **
* @: j( s3 x t$ v8 h% B3 k
1 |: U- D- E9 O 目前我采用的空间是PHP+MYSQL类型的,有关于PHP方面的编程问题,欢迎一起讨论
: U0 l# _8 e3 F: O, x 我写了一段PHP邮件例程也在下面,供参考:
% P2 o+ v+ N/ h' q1 Y" [& e , w3 `: ~, E$ j" }) Z; I( R# l; ^6 s
例程如下:
6 p( j4 d# d1 s3 `+ T <?
# B7 h. i' s4 o0 Z if($send){
6 K" ^$ Z" G! D- @5 W& ] $hearer="From from\nReply-T$from\nX-Mailer: PHP/".phpversion()."\nContent-Type:text/html";
* h0 D" P: U& @) b $result=mail($to,$subject,$body,$hearer);
6 s( T' V7 N& s- j& B if($result) z; A+ N- D0 _# v! ]# {
echo "邮件已成功发送";
+ d; N {5 O' G! Q( V }
2 [5 X8 A/ U, O& F9 }$ O ?> 3 A* x& h* s' b' T, x g. x
<html>
: h$ a, I5 j& ^8 | <body> : {7 w- P' k: ^ l. g' s
<table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#6699FF">
3 i' J$ n9 E; u2 d+ G6 V <form method="post">
# k: j. ]4 {2 N, d. g* _7 p <tr bgcolor="#E7E7CB">
& @+ N; |2 Z' o9 u <td width="20%" height="26">发件人:</td> 9 W. A4 Y1 {: \4 b4 S
<td width="80%"><input name="from" type="text"></td>
! h: O% m' o+ {5 }8 { </tr>
' T5 l8 U8 f' e4 r' [ n <tr bgcolor="#E7E7CB"> " n3 e3 M$ |. ^" P T# N
<td height="25">收件人:</td>
- V1 L8 z4 D) D9 p <td><input name="to" type="text"></td>
4 {6 Q# Y2 z! f2 y/ t# M( K* F </tr> / A( T/ u, S& u& s* J8 X5 [
<tr bgcolor="#E7E7CB">
% G0 M6 w9 y# E; i2 A* U/ U2 E <td height="24">邮件标题:</td>
/ d) t( N, C3 s0 V <td><input name="subject" type="text" size="50"></td> 5 f4 W% t5 H" i6 c
</tr>
- v7 ^1 T3 n. G, w3 w <tr bgcolor="#E7E7CB">
9 C. @4 |1 e) M) Z6 ~6 Q6 O <td height="27">邮件内容:</td>
5 g5 d9 `' z7 d6 F8 L' @8 y9 d <td><textarea name="body" cols="60" rows="10"></textarea></td>
+ K' d2 x" O2 K6 n8 I/ o2 i </tr> 8 `0 K6 I( q9 w
<tr bgcolor="#E7E7CB"> - E; F. k' T& g5 c
<td height="28"> </td> ; e. n3 K4 \% k/ N9 o: g
<td> & p) B+ e3 d. H: s
<input type="hidden" value="1" name="send">
/ s# {4 r0 q. ~+ _ <input type="submit" name="Submit" value="提交">
3 U2 ^9 k; a: ]: R) O% \. C <input type="reset" name="Submit2" value="重置"></td>
# n* u, t4 M/ [" j( ?, N </tr>
/ @" B* e, m7 z+ Z0 R </form>
7 A4 s- O9 a% u9 D/ b7 h3 _ </table> ! P3 _4 [+ b0 S" P% R1 n3 G) W
</body>
3 {$ ]9 z6 m( `( w- L/ J8 Y </html> 5 T1 b0 c8 x/ C
4 A% w; Z+ v+ Y2 T! {2 | -------------------------------------------------------------------------------- " t1 G F+ n# q- s; R$ o
时代互联 (www.now.net.cn/host) 的PHP 虚拟主机性能:
& {! N- ]: ` a4 C- ^6 U 6 t+ B, E# ] S* w
PHP4.3.6 GD2.1x mhash iconv 支持Zend 加速及加密 XML kerberos IMAP ZLIB CURL
8 R1 _& Y! H8 ?$ J- i0 i& J Apache2 PHP 内核整合 MySQL4.0.17 带phpMyAdmin 管理后台 支持网站访问统计 6 m0 E6 `2 F+ Z1 M' b4 q* U) g
% \) z" d `3 S- q
★送免费的留言板和计数器 ,流量访问系统 1 L; N$ [! m9 {' H6 ]6 _/ m
6 G) p1 g+ [( N
推荐类型: . X& L I0 X( t q: t1 o' }
! V5 M+ X# I/ J% _% W' W# T" D6 V0 p 商务型B+.CN域名 送800M 空间邮箱 1300元/年 ) g* z( D) X( g& s" ?
点击: http://now.net.cn/host/commerce.net?PHPSESSID=aca5c80915ad9bcc097e352cf57e9d61
* r0 N# k d- f6 j( b( f% m 虚拟专用型B+.CN域名+国际顶级域名 送2000M VIP 企业邮局 配置MYSQL数据库 3800元/年
1 w$ |6 h2 [) Y0 B" J
: I- i# Y9 B4 V. ]6 z" X 订购地址:
5 ~, b0 F+ d9 ]+ D, P http://now.net.cn/host/vps.net?PHPSESSID=aca5c80915ad9bcc097e352cf57e9d61- y6 W; M9 Y( V, a
-------------------------------------------------------------------------------
! O3 D8 Z- f2 U5 Q, q 虚拟主机的优势: http://now.net.cn/news/MessView.net?IDMessage=4607 $ u a# \5 R5 [' s- `* x% Y9 a2 [
全球免费咨询电话,请点击 http://www.now.net.cn/customer/moreline.net
8 x1 o |) G6 L- O7 A0 Q" s Q Q在线咨询:188092185 108786612 2 J: y N. m. A# B6 i% j7 y) o
TEL:0756-3813159 3813160 |