我的CI控制器没有发送电子邮件或加载成功页面

时间:2014-04-17 19:42:06

标签: php codeigniter email controller

我是新来的,但我遇到了这个问题,控制器几天前工作正常,现在什么都没有。它应该发送电子邮件reg,但它不起作用......

class Cs extends CI_Controller {

    public function __construct()
    {
        parent::__construct();
    }

    public function index()
    {

        $this->load->view('cs');

    }

    public function apply() {

        $data = $this->input->post();

        if ($data) {


            $this->load->library('email');
            $this->email->from('mail@mail.com', 'name');
            $this->email->to('mail@mail.com'); 
            $this->email->subject('Nova prijava za FGL takmicenje - COUNTER STRIKE');
            $this->email->message(
                "Tim: " . $data['teamname'] . 
                "Clanovi tima:

                1. Ime i prezime:" . $data['ime1'] . ", nickname: " . $data['nick1'] . ", email: " . $data['email1'] . ", JMBG: " . $data['jmbg1'] . " 
                2. Ime i prezime:" . $data['ime2'] . ", nickname: " . $data['nick2'] . ", email: " . $data['email2'] . ", JMBG: " . $data['jmbg2'] . " 
                3. Ime i prezime:" . $data['ime3'] . ", nickname: " . $data['nick3'] . ", email: " . $data['email3'] . ", JMBG: " . $data['jmbg3'] . " 
                4. Ime i prezime:" . $data['ime4'] . ", nickname: " . $data['nick4'] . ", email: " . $data['email4'] . ", JMBG: " . $data['jmbg4'] . " 
                5. Ime i prezime:" . $data['ime5'] . ", nickname: " . $data['nick5'] . ", email: " . $data['email5'] . ", JMBG: " . $data['jmbg5']);    

            $this->email->send();

            redirect('/cs/success');

        }
        else {
            redirect('/');
        }

    }

    public function success()
    {
        $this->load->view('success');
    }
}

1 个答案:

答案 0 :(得分:0)

您是否在php.ini文件中启用了OpenSSL扩展程序?

转到安装PHP的目录,打开php.ini并删除

中的;
;extension=php_openssl.dll