1
votes

I m using Wamp Server (Local Host)

Error Message

A PHP Error was encountered Severity: Warning Message: 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() Filename: libraries/Email.php Line Number: 1553

Controller

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

        //Email Verification  

            $key = md5(uniqid());
            $this->load->library('email',array('mailtype'=>'html'));
            $this->email->from ('[email protected]','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 [email protected]";





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

} 

May I know why that error message came and how to resolve?

1

1 Answers

0
votes

You need to configure your server for mailing first. Take a look at this handy tutorial and you should be on your way.

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!