Sending email with gmail smtp with codeigniter email library

后端 未结 8 2169
情书的邮戳
情书的邮戳 2020-11-22 06:29
load->library(\'email\');
    }

    func         


        
8条回答
  •  无人及你
    2020-11-22 07:25

    send html email via codeiginater

        $this->load->library('email');
        $this->load->library('parser');
    
    
    
        $this->email->clear();
        $config['mailtype'] = "html";
        $this->email->initialize($config);
        $this->email->set_newline("\r\n");
        $this->email->from('email@example.com', 'Website');
        $list = array('xxxxxxxx@archmage.lk', 'xxxxx@gmail.com');
        $this->email->to($list);
        $data = array();
        $htmlMessage = $this->parser->parse('messages/email', $data, true);
        $this->email->subject('This is an email test');
        $this->email->message($htmlMessage);
    
    
    
        if ($this->email->send()) {
            echo 'Your email was sent, thanks chamil.';
        } else {
            show_error($this->email->print_debugger());
        }
    

提交回复
热议问题