用PHP写mail函数 配置好后需要重启apache

上一篇 / 下一篇  2006-11-24 15:02:52

<?php

'wh1W&~1D(o0$tomail='boy805@tom.com';
*D+sE%LA0$name='liuyu';
:xhI wuq0R |5q8z;R0$text='you win!!';PHPChina 开源社区门户$s s#t A1tfz{xU

5@3dz8H2@:r.RsT1|s0if(mail($tomail,$name,$text)) //函数有5个参数前3个是必填参数。第一个参数表示目的地址,第二个                                参数表示为主题,第三个参数表示内容。PHPChina 开源社区门户[U fm8r-F
{PHPChina 开源社区门户j }~-k|7LegA
    echo 'ok';PHPChina 开源社区门户,_h _ F9_
}PHPChina 开源社区门户"DmPy6ch:p
else
4?"XKAuQ0{PHPChina 开源社区门户o8SWW9M0a|
    echo 'no';
'[#b'i)Z#F.j0}

4p,\ ?-y!w\ }0

f,N+[SIl.fM0?>
6Q W"b6~:^o:eN?3X0要注意的一点是,mail函数的使用,需要在php.ini里边配置。PHPChina 开源社区门户9iL2GQG,w
[mail function]PHPChina 开源社区门户3h&L$J4^S
; For Win32 only.PHPChina 开源社区门户2H2l,qz3V
SMTP = localhost
/om)_-T*v0smtp_port = 25PHPChina 开源社区门户+OxqE-Ye/mJ

!\/B!pf Y8h0; For Win32 only.PHPChina 开源社区门户 `{e"zn
;sendmail_from =me@example.comPHPChina 开源社区门户@+u;^C+Yb

PHPChina 开源社区门户$Eukl hg

配置后
D,GM _*?"HF0[mail function]
uW9a.dL(?I(\x-a0; For Win32 only.
F5CD1x1l+Rjw5R0SMTP = smtp.tom.com //指定你的邮箱smtp
S7[tM*o.^O2n7o0smtp_port = 25

!S@3NS)q"sk+_FS0PHPChina 开源社区门户K/t1H A$OGLQ

; For Win32 only.PHPChina 开源社区门户2A y3Vb)?$zDQ
sendmail_from =boy805@tom.com//你所使用的邮箱

i9nT7G9Fb9P0

4^ ^,U%_ X*\2eGR0配置好后要记得重启apache啊!

r(fzg0JaZJ e0

TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

数据统计

  • 访问量: 29335
  • 日志数: 99
  • 图片数: 1
  • 建立时间: 2006-10-25
  • 更新时间: 2007-02-06

RSS订阅

Open Toolbar