Advertisement
Guest User

send mail

a guest
Jan 8th, 2018
197
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. public function send_mail(){
  2. $ci = get_instance();
  3. $ci->load->library('email');
  4. $config['protocol'] = "smtp";
  5. $config['smtp_host'] = "ssl://smtp.gmail.com";
  6. $config['smtp_port'] = "465";
  7. $config['smtp_user'] = "*******@gmail.com";
  8. $config['smtp_pass'] = "*******";
  9. $config['charset'] = "utf-8";
  10. $config['mailtype'] = "html";
  11. $config['newline'] = "\r\n";
  12.  
  13.  
  14.  
  15. $pesan =" isi email ";
  16.  
  17. $ci->email->initialize($config);
  18. $ci->email->from('*********@gmail.com', '******* Pekanbaru'); /* pengirim */
  19. $list = array('*******@gmail.com'); /* penerima */
  20. $ci->email->to($list);
  21. $ci->email->subject('L*******');
  22. $ci->email->message($pesan);
  23.  
  24. if($this->email->send()){
  25. echo 'email sent';
  26. } else{
  27. show_error($this->email->print_debugger());
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement