【问题标题】:Failed to connect to mailserver in CodeIgniterCodeIgniter 连接邮件服务器失败
【发布时间】:2013-04-08 11:01:58
【问题描述】:

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

错误信息

遇到 PHP 错误 严重性:警告 消息:mail() [function.mail]:无法在“localhost”端口 25 连接到邮件服务器,请验证 php.ini 中的“SMTP”和“smtp_port”设置或使用 ini_set() 文件名:库/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');
        }

} 

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

【问题讨论】:

    标签: codeigniter


    【解决方案1】:

    您需要先配置您的服务器以进行邮件发送。看看这个方便的教程,你应该已经开始了。

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

    如果您在确定 ISP 的 SMTP 服务器时遇到问题,可以查看以下目录: http://www.arclab.com/products/amlc/list-of-smtp-and-pop3-servers-mailserver-list.html

    希望这会有所帮助!

    【讨论】:

    • 如果您需要任何进一步的说明,请询问
    • 兄弟。我在您发送roshanbh.com.np/2007/12/… 的链接中发现有点困惑,链接中说打开“php.ini”。但是我的 wamp 中有 2 个 php.ini 文件。那么我在哪一个中进行配置?两个都? 1 - C:\wamp\bin\apache\apache2.2.22\bin\php.in 2 - C:\wamp\bin\php\php5.3.13\php.in
    • apache 文件应该是正确的,但您可以同时配置两者以确保
    猜你喜欢
    • 2013-07-02
    • 1970-01-01
    • 2017-11-09
    • 2016-06-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多