XAMPP邮件服务器Mercury的设置方法

为了在本地环境测试注册邮件功能,开启了XAMPP的Mercury,邮件服务器,但奇怪的是,使用Sent mail message,却不能发送成功。上网找了很久,总结出设置方法。

  1. 启动Apache和MySQL服务;
  2. 点击 Mercury 顶部菜单的“Configuration / MercuryS SMTP Server” ,在弹出的对话框上点击“Connection control”标签页,去掉“Do not permit SMTP relaying of non-local mail”这一项的勾选,然后点击“确定”;
  3. 点击 Mercury 顶部菜单的“Configuration / Protocol modules” ,在弹出的对话框里取消“MercuryB HTTP web server”、“Mercury IMAP4rev1 server”的选择,然后在“MercuryC SMTP relaying client”前勾选,同时也是取消了“MercuryE SMTP end-to-end delivery client”勾选,点“确定”,重启Mercury;
  4. 点击 Mercury 顶部菜单的“Configuration / Mercury core module” ,在弹出的对话框里进入“General”标签页,在“internet name for this system”里填入“localhost”;在下面,除了“Send copies of all errors to postmaster”外,全部取消勾选;进入“Local domains”标签页,确认有“localhost (local host or server) localhost (internet name)”值对,如果没有,手动添加上,点“确定”;
  5. 点击 Mercury 顶部菜单的“Configuration / MercuryS SMTP Server” ,在弹出的对话框里进入“General”标签页,在“Announce myself as”里填入你喜欢的名字,比如“super smtp”;在“IP interface to use”里填入“127.0.0.1”;在“Connection Control”标签页里,取消全部勾选,点“确定”;
  6. 点击 Mercury 顶部菜单的“Configuration / MercuryC SMTP Client” ,这里的设置很重要,基本上可以说成败在此一举,如果要对外发邮件,还得有另外可用的SMTP服务器,在“Smart host name”里填入,比如“smtp.gmail.com”;“Connection port/type”是“25”/SSL encryption via STARTTLS command(gmail是得这么设置);在“Login username”和“Password”里填入用户名和密码;
  7. 点击 Mercury 顶部菜单的“Configuration / Manage local users” ,在这里添加或设置用户名和密码,外部程序要用到这个才能使用本邮件服务;
  8. 在“xampp/php/php.ini”中查找[mail function]确定以下的键值对设置:
    • “SMTP = localhost”
    • “smtp_port = 25″
    • “sendmail_from = postmaster@localhost”

好了,现在应该可以试试“Sent mail message”了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章