Guest User

Untitled

a guest
Nov 20th, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. <!-- Sending html view in email with codeigniter -->
  2. #email_marketing #email_template
  3.  
  4. $config = Array(
  5. 'protocol' => 'sendmail',
  6. 'smtp_host' => 'Your host name',
  7. 'smtp_port' => 587,
  8. 'smtp_user' => 'your email',
  9. 'smtp_pass' => 'email's password',
  10. 'smtp_timeout' => '4',
  11. 'mailtype' => 'html',
  12. 'charset' => 'iso-8859-1'
  13. );
  14. $this->load->library('email', $config);
  15. $this->email->set_newline("\r\n");
  16.  
  17. $this->email->from('your email', 'Title');
  18. $data = array(
  19. 'name'=> 'value'
  20. );
  21. $this->email->to('recevier email address');
  22.  
  23. $this->email->subject('subject');
  24.  
  25. $this->email->set_header('MIME-Version', '1.0; charset=utf-8');
  26.  
  27. $this->email->set_header('Content-type', 'text/html');
  28.  
  29. $body = $this->load->view('folder/file',$data,TRUE);
  30.  
  31. $this->email->message($body);
  32.  
  33. $this->email->send();
Add Comment
Please, Sign In to add comment