mardi 24 avril 2018

Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set();

I have tried every single way on the internet but non of those solve my problem and i am also try ini_set() but still not working public function send_email(){

        ini_set("SMTP","localhost");
        ini_set("smtp_port","25");
        ini_set('sendmail_from', 'example@YourDomain.com');*/
        $from_email = "asifh09@gmail.com";
        $to_email = $this->input->post('email');

        $this->load->library('email');

        $this->email->from($from_email,'Your Name');
        $this->email->to($to_email);
        $this->email->subject('email template');
        $this->email->message('Testing email class');
        if($this->email->send()){
            $this->session->set_flashdata("email_sent","Email sent successfully");
        }
        else{
            //$error = array('error'=>$this->email->display_errors());
            $this->session->set_flashdata("email_sent","Email is not send");
        }
        $this->load->view('email_form');

    }

Aucun commentaire:

Enregistrer un commentaire