Guest User

Untitled

a guest
Feb 24th, 2018
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. function __construct() {
  2. parent::__construct();
  3. $this->load->model('example');
  4. }
  5.  
  6. class Contact extends CI_Controller {
  7.  
  8. public function __construct(){
  9. parent::__construct();
  10. $this->load->model('contact_model', 'contact');
  11. }
  12.  
  13. public function index(){
  14. $data['contact'] = $this->contact->getContact();
  15. $this->load->view('contact', $data);
  16. }
  17.  
  18. public function send_mail(){
  19. /* Mail configuration - ONLY USED HERE */
  20. $config = array('protocol' => 'mail',
  21. 'wordwrap' => FALSE,
  22. 'mailtype' => 'html',
  23. 'charset' => 'utf-8',
  24. 'crlf' => "rn",
  25. 'newline' => "rn",
  26. 'send_multipart' => FALSE
  27. );
  28. $this->load->library('email', $config);
  29. $records = $this->contact->getCompany();
  30.  
  31. $this->email->from( $setmail, $records['CompanyName'] );
  32. $this->email->to( $to );
  33. $this->email->subject( $subject );
  34. $this->email->message( $html );
  35. $this->email->send();
  36. }
  37.  
  38. }
Add Comment
Please, Sign In to add comment