1

我正在使用 Wamp 服务器(本地主机)

错误信息

遇到 PHP 错误 严重性:警告消息:mail() [function.mail]:无法在“localhost”端口 25 连接到邮件服务器,请验证 php.ini 中的“SMTP”和“smtp_port”设置或使用 ini_set()文件名:libraries/Email.php 行号:1553

控制器

if ($this->form_validation->run() == TRUE)
        {

        //Email Verification  

            $key = md5(uniqid());
            $this->load->library('email',array('mailtype'=>'html'));
            $this->email->from ('info@worldquotes.in','Admin');
            $this->email->to($this->input->post('email'));
            $this->email->Subject('Confirm YOur Account');

            $message = "<p> thank you for Signing Up </p>"; 
            $message .= "<p> <a href= '".base_url()."main/register_user/$key '> Click here </a> to Confirm Your Account  </p>";
            $this->email->message($message);
            if ($this->email->send()) {

            echo "Then Email has been Send";

            }else echo "Could ot send the Email, Contact info@worldquotes.in";





        }
        else
        {
            $this->load->view('signup');
        }

} 

我可以知道为什么出现该错误消息以及如何解决吗?

4

1 回答 1

0

您需要先配置服务器以进行邮件发送。看看这个方便的教程,你应该在路上。

http://roshanbh.com.np/2007/12/sending-e-mail-from-localhost-in-php-in-windows-environment.html

If you're having trouble figuring out your ISP's SMTP server, you could take a look in this catalog: http://www.arclab.com/products/amlc/list-of-smtp-and-pop3-servers-mailserver-list.html

Hope this helps!

于 2013-04-08T11:18:32.093 回答