Advertisement
cahyadyazin

sendmail codeigniter

Oct 21st, 2014
203
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.36 KB | None | 0 0
  1.  
  2. # sendmail.php
  3.  
  4. smtp_server=smtp.gmail.com
  5. smtp_port=587
  6. smtp_ssl=auto
  7.  
  8. error_logfile=error.log
  9.  
  10. auth_username=dyazincahya.cd@gmail.com
  11. auth_password=***
  12.  
  13. pop3_server=
  14. pop3_username=
  15. pop3_password=
  16.  
  17. force_sender=
  18. force_recipient=
  19.  
  20. hostname=
  21.  
  22. # php.ini
  23.  
  24. SMTP = smtp.gmail.com
  25. smtp_port = 587
  26.  
  27. sendmail_from = dyazincahya.cd@gmail.com
  28.  
  29. sendmail_path = "\"D:\xampp\sendmail\sendmail.exe\" -t"
  30.  
  31. sendmail_path = "D:\xampp\mailtodisk\mailtodisk.exe"
  32.  
  33. # controllers
  34.  
  35.         function mail()
  36.         {
  37.             $config = Array(
  38.           'protocol' => 'smtp',
  39.           'smtp_host' => 'ssl://smtp.gmail.com',
  40.           'smtp_port' => 587,
  41.           'smtp_user' => 'dyazincahya.cd@gmail.com', // change it to yours
  42.           'smtp_pass' => '***', // change it to yours
  43.           'mailtype' => 'html',
  44.           'charset' => 'iso-8859-1',
  45.           'wordwrap' => TRUE
  46.         );
  47.  
  48.               $message = 'aku mau coba coba';
  49.               $this->load->library('email', $config);
  50.               $this->email->set_newline("\r\n");
  51.               $this->email->from('dyazincahya.cd@gmail.com'); // change it to yours
  52.               $this->email->to('dyazincahya@gmail.com');// change it to yours
  53.               $this->email->subject('Resume from JobsBuddy for your Job posting');
  54.               $this->email->message($message);
  55.               if($this->email->send())
  56.              {
  57.               echo 'Email sent.';
  58.              }
  59.              else
  60.             {
  61.              show_error($this->email->print_debugger());
  62.             }
  63.  
  64.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement