CodeIgniter Forums
built email html - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: built email html (/showthread.php?tid=25924)



built email html - El Forum - 12-30-2009

[eluser]tnathos[/eluser]
hi.. i try to build a message html but always the email is text... dont show me a image and dont apply the tags html...

this the code

Code:
$mensaje = "Adjunto encontrarasla informacion generado para la promocion seleccionada, si no tienes impresora puedes presentar el siguiente codigo con el cual tendras acceso a la promocion </br> \n";
        
        $mensaje .= "Codigo = ". $cod_k. "</br> \n";
        
        $mensaje .= '<img src="http://localhost:8888/app/system/files/img/logo.png">';
    

        $this->load->library('email');
        $config['charset'] = 'iso-8859-1';
        $config['wordwrap'] = TRUE;
        $config['protocol'] = 'mail';
        $config['mail_type'] = 'html';
        
        $this->email->initialize($config);
        
        $this->email->from('[email protected]');
        $this->email->to($emailk);
        $this->email->set_newline("\r\n");
        
        $this->email->subject('new message');
        $this->email->message($mensaje);
        

        return $this->email->send();



built email html - El Forum - 12-30-2009

[eluser]Ben Edmunds[/eluser]
$mensaje needs to be a complete html page with &lt;html&gt;, &lt;body&gt;, etc...

I like to build a view and then simply load the view into the email.