安装并运行SMTP服务器(不一定要IIS的, 其他的SMTP服务器也可)
php.ini中:
[mail function]
; For Win32 only.
SMTP = localhost;SMTPserver主机名; For Win32 only.
sendmail_from = me@localhost ;发信的帐号.
php.ini中:
[mail function]
; For Win32 only.
SMTP = localhost;SMTPserver主机名; For Win32 only.
sendmail_from = me@localhost ;发信的帐号.
在已经启动smtp服务的情况下。
我用的是自己学校的!
如何设置及如何调用email()函数??
[mail function]
; For Win32 only.
SMTP = smtp.163.com; For Win32 only.
sendmail_from = [email protected]然后设置你的OE,添加username这个账号,注意服务器需要身份验证
在PHP程序中调用mail()函数(注意:是mail()函数,不是email()函数),系统会自动调用OE来发信。
也不一定就是OE,是你默认的邮件工具,可能也会是Foxmail反正就是把你的默认的邮件工具设置好,能够发出去邮件就行了
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in c:\www\mail.php on line 6
error
你的mailserver还是"localhost"