在笔记本(运行的Windows Vista)上安装了个osCommerce,注册用户时显示下面的错误:
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:\xampp\htdocs\oscommerce\catalog\includes\classes\email.php on line 522
显然本地邮件系统不工作。我更改了php.ini,另给了一个smtp server,依然是这个错误,可能需要重启,不知道除了关机重启外,还怎么能重启php,放弃;
XAMPP有一项sendmail,说
How to use sendmail in XAMPP for Windows http://i.justrealized.com/2008/05/02/how-to-use-sendmail-in-xampp/
说将sendmail.ini里的参数改为:
smtp_server=smtp.justrealized.com
auth_username=****@justrealized.com
auth_password=***
就是自己的邮箱、密码、和STMP服务器; 我的sendmail.ini没有这三项,有个free mail example,可能类似,不过,这个也放弃;
决定把XAMPP带的Mercury Mail好好调试一下,它应该有个smtp服务器的。
Mercury Mail 的网站: http://www.pmail.com
通过Mercury/32的“file”项下的“send mail message”发了邮件给我的hotmail信箱,在“Mercury Core Process”显示:
Mon 26, 13:53:48: Job MG000001: from postmaster@localhost (local)
Created outgoing job with ID MO000396
To: ***@hotmail.com (non-local) -OK
不过在“Mercury SMTP Client(relay version)”上关于这个邮件没什么显示,只是显示:
Status and connection control Offline
问题估计就在这里,把它调整到online应该就可以了,不过,怎么调呢,待续。
到“Configuration”里的“Protocol Modules”里把“MercuryX Connection and Process scheduler”前的“v”去掉,把Mercury关掉重启,“Mercury SMTP Client (relay version)”的“offline”去掉了,变为:
Idle: next poll 14:32:49
不过出现新的错误:
failed.
Error FF servicing queus job.
待续
到“MercuryC SMTP Client”里的Smart host name里写上SMTP服务器的地址,比如smtp.gmail.com,或者自己web空间的smtp服务器网址。
下面选择SSL encryption using direct connection,端口号选465,选Normal(no SSL encryption)不工作,端口25。
在Credentials for SMTP Authentication,if required项,如果上面host name写的smtp.gmail.com,就写你的gmail邮箱和密码,这时收到的信地址就是这个地址; 如果写自己web空间的smtp服务器网址,写空间的用户名、密码,收到的信地址显示: E-Mail Administrator (postmaster@localhost) 。我的信用这个发直接就放到垃圾箱了。
在网上见到这句话:
Pegasus Mail and The Mercury Mail Transport System, the Internet's longest-serving PC e-mail system!
我的理解就是,Pegasus Mail是客户端,Mercury是服务器。
pegasus['pegəsəs]
n. 有翼的马,神马,飞马座,
Mercury['mə:kjuri]
n. 水银,水星
这个连接不错,讲基础知识的:
Mercury Mail Transport System for Win32
感觉通过Mercury往互联网上发邮件的整个过程就是把本地机器的邮件发送到网上一个SMTP服务器,在那里给转发到其他邮箱里。