CodeIgniter Forums
sending html email - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: sending html email (/showthread.php?tid=38396)



sending html email - El Forum - 02-07-2011

[eluser]kmunky[/eluser]
hi, i'm trying to send an html message but all i get is the html code as string not parsed html. here's my code:

Code:
function send(){
        
         $config = array(
            'type' => 'html'
          );
    
    //load parser library
    $this->load->library('parser');
    $email = $this->input->post("email");
    $data = array();
    
    $content = $this->parser->parse("invitatie_template",$data);
    
    $this->load->library('email',$config);
    //$this->email->initialize($config);    
  
    $this->email->from('[email protected]', 'name');
    $this->email->to($email);

    $this->email->subject('title');
    
    
    $this->email->message($content);    

    
    $this->email->send();  
    
    $this->load->view("mail_form");
    
    
    }



sending html email - El Forum - 02-07-2011

[eluser]umefarooq[/eluser]
hi you have to define mail type either html or just text message check you config is wrong

Code:
$config = array('mailtype'=>'html');

not only type