数学建模社区-数学中国

标题: ** 用PHP 发邮件例程 ,欢迎参考 ** [打印本页]

作者: yengff    时间: 2005-3-18 15:08
标题: ** 用PHP 发邮件例程 ,欢迎参考 **

** 用PHP 发邮件例程 ,欢迎参考 ** 2 B/ x8 w9 l3 O / }- ?, m* q. X; C 目前我采用的空间是PHP+MYSQL类型的,有关于PHP方面的编程问题,欢迎一起讨论 6 b. [; w# T, x6 m7 D8 ^ 我写了一段PHP邮件例程也在下面,供参考: 1 X2 w. M6 c* x # a$ n }* t1 ] 例程如下: ) ~6 T8 @, ]6 z5 W; H <? " ? @0 |& f8 Y. w1 V6 @3 ]! J if($send){ ( U5 l/ ~# b/ `4 L* I $hearer="Fromfrom\nReply-T$from\nX-Mailer: PHP/".phpversion()."\nContent-Type:text/html"; / @: ~& j9 Q' H D) U6 u $result=mail($to,$subject,$body,$hearer); 3 v( n8 y5 `% C2 s8 O* j2 {; n' @ if($result) $ }/ ^% n% m+ e echo "邮件已成功发送"; 3 H: ]$ N4 s7 m/ @7 B% s, t } 6 x, P/ p1 z+ G% Y2 `9 X ?> ! h4 @ T6 E G8 {2 E <html> / t8 e& C' C7 P- `1 |. U S1 _( d6 ` <body> / x( |% F$ ^! P& I8 H <table width="100%" border="0" cellpadding="1" cellspacing="1" bgcolor="#6699FF"> # E9 {9 t' I; O9 p+ J <form method="post"> * z8 @% F U; T) L3 g& y1 M; w0 A <tr bgcolor="#E7E7CB"> 7 q: m3 ?6 w6 |$ d: m: S <td width="20%" height="26">发件人:</td> % m+ l! a Z( ~+ r <td width="80%"><input name="from" type="text"></td> : D2 l, d _7 y, l </tr> 6 [2 s: u) M- @5 V <tr bgcolor="#E7E7CB"> & K! d. s/ j% Z# Y <td height="25">收件人:</td> 9 r- o5 X3 Z/ i <td><input name="to" type="text"></td> & a) ] {) x: Z </tr> # h G# X" y. w7 f <tr bgcolor="#E7E7CB"> I2 e' _6 E/ M7 v& w A <td height="24">邮件标题:</td> 8 ^9 g/ K: [- \: Y5 F3 M+ ^, [7 { <td><input name="subject" type="text" size="50"></td> ! j! A J s; s E, [3 _2 R </tr> 2 b0 W/ e8 } h+ d/ g6 R <tr bgcolor="#E7E7CB"> ( F% D- u' h) n8 T4 K <td height="27">邮件内容:</td> ' C! D6 j$ q3 U" c- I0 D# L: o <td><textarea name="body" cols="60" rows="10"></textarea></td> 5 t& t7 U8 T* D1 g3 A* E$ o7 O </tr> , Q5 o& o7 C4 U6 T. D) N, c <tr bgcolor="#E7E7CB"> ( d3 w; @7 z! M. [ <td height="28"> </td> 2 I. k# I0 t& @3 Q/ Y <td> % B: y( f6 f& |% w6 h0 D <input type="hidden" value="1" name="send"> 3 g5 L$ ?, `- z2 o7 I% W0 C <input type="submit" name="Submit" value="提交"> / H/ F3 ^: @% [+ o1 W6 r <input type="reset" name="Submit2" value="重置"></td> ; D/ ]/ a M/ Q8 e: _ </tr> $ t" s; i8 Q2 P* R </form> 0 }5 ^0 [8 h0 @& a$ @ </table> " d. i9 N1 ~$ E, Q2 n$ O. @$ d! o' e! e </body> 1 ~# Z4 M! `6 B9 e- r </html> " \# T- l, e) [0 Q1 Y $ @, I& J7 T9 d -------------------------------------------------------------------------------- / ]5 {; e* C0 p5 Q" l# n7 ^ 时代互联 (www.now.net.cn/host) 的PHP 虚拟主机性能: 7 C' d0 l( q4 D6 Y, p) L 4 u7 `8 B, U: o PHP4.3.6 GD2.1x mhash iconv 支持Zend 加速及加密 XML kerberos IMAP ZLIB CURL ( c2 m$ {4 {( S Apache2 PHP 内核整合 MySQL4.0.17 带phpMyAdmin 管理后台 支持网站访问统计 7 E$ k- S. q; v! U * O: V! Q9 v* ~/ H% I7 j5 w# @1 E ★送免费的留言板和计数器 ,流量访问系统 6 G6 I( D% W3 M1 h& ?# T% j 1 J- G9 o n" L$ o p) _& r 推荐类型: " }3 n# e8 l1 c9 i2 K1 o" { $ V2 c3 B* j. f$ g 商务型B+.CN域名 送800M 空间邮箱 1300元/年

+ I( q4 @% E. O( V4 \5 N3 Y

点击: http://now.net.cn/host/commerce.net?PHPSESSID=aca5c80915ad9bcc097e352cf57e9d61

0 S+ b! W6 d3 x8 _, m$ |) Q

虚拟专用型B+.CN域名+国际顶级域名 送2000M VIP 企业邮局 配置MYSQL数据库 3800元/年 ! B! m; B6 U4 q% B& S( w6 l P: y8 Z, V0 b1 S, A. U. y 订购地址: 3 N/ G: u1 o" i) v5 D$ M+ Y# c: t http://now.net.cn/host/vps.net?PHPSESSID=aca5c80915ad9bcc097e352cf57e9d61+ H# k6 F, x. ?5 h7 | ------------------------------------------------------------------------------- ' G* W, S1 V+ ?; | 虚拟主机的优势: http://now.net.cn/news/MessView.net?IDMessage=4607 ( ~7 T; @0 p T& B' |* B 全球免费咨询电话,请点击 http://www.now.net.cn/customer/moreline.net ' R/ K# a; d8 P E2 V Q Q在线咨询:188092185 108786612 " V6 X7 l" M( [% u5 t TEL:0756-3813159 3813160






欢迎光临 数学建模社区-数学中国 (http://www.madio.net/) Powered by Discuz! X2.5