Guest User

Untitled

a guest
Apr 11th, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. public function sendMail(){
  2. $config = array(
  3. 'protocol'=>'smtp',
  4. 'smtp_host'=>'ssl://smtp.gmail.com',
  5. 'smtp_port'=>465,
  6. 'smtp_user'=>'********@gmail.com',
  7. 'smtp_pass'=>'*********',
  8. 'mailpath'=> "/usr/sbin/sendmail",
  9. 'mailtype'=>'html',
  10. 'charset' => 'utf-8',
  11. 'send_multipart'=>FALSE
  12. );
  13.  
  14. $this->load->library('email',$config);
  15. $this->email->initialize($config);
  16. $this->email->set_newline("rn");
  17. $this->load->library('encrypt',$config);
  18.  
  19. $this->email->from('******@gmail.com');
  20. $this->email->to('******@gmail.com');
  21. $this->email->cc('******@gmail.com');
  22. $this->email->subject('Email Test');
  23. $this->email->message('Testing the email class.');
  24.  
  25. if($this->email->send()){
  26. echo "Email sent success";
  27. }else{
  28. show_error($this->email->print_debugger());
  29. }
  30. }
Add Comment
Please, Sign In to add comment