分类:
2009-02-02 17:58:46
php mail 发送:
1、修改php配置文件php.ini
[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25
; For Win32 only.
;sendmail_from = me@example.com
; For Unix only. You may supply arguments as well (default: "sendmail -t -i").
sendmail_path = /usr/sbin/sendmail -t -i //打开开关,添加-t -i参数[修改这里]
; Force the addition of the specified parameters to be passed as extra parameters
; to the sendmail binary. These parameters will always replace the value of
; the 5th parameter to mail(), even in safe mode.
;mail.force_extra_parameters =
2、检查sendmail服务是否启动
3、启动sendmail :
sudo /etc/rc.d/init.d/sendmail start
或者 sudo /usr/sbin/sendmail -bd
4、检查 邮件队列情况 /usr/sbin/sendmail -bp
也可以查看目录 /var/spool/mqueue 注意他的属主是root 组: mail
5、好了,开始发送邮件吧~
reasonpun2009-11-20 11:24:42
有时候我会遇到这样的情况:
[root@BJ-FT-1F-120-3 ~]# mail -s "192.168.120.3:31%used in /usr" reasonpun@139.com<