Advertisement
Guest User

Untitled

a guest
May 12th, 2016
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. public function index(){
  2. $config=array(
  3. 'protocol' => 'smtp',
  4. 'smtp_host' => 'ssl://smtp.googlemail.com',
  5. 'smtp_port' => 587,
  6. 'smtp_user' => 'aziz.10786@gmail.com',
  7. 'smtp_pass' => 'password',
  8. 'mailtype' => 'html',
  9. 'charset' => 'iso-8859-1'
  10. );
  11. $this->load->library('email', $config);
  12. $this->email->set_newline("rn");
  13. //send mail
  14. $this->email->from('aziz.10786@gmail.com','aziz');
  15. $this->email->to('aziz.10786@gmail.com');
  16. $this->email->subject('testing mail');
  17. $this->email->message('successfully working');
  18.  
  19. if($this->email->send()){
  20. echo 'your email sent';
  21. }
  22. else{
  23. show_error($this->email->print_debugger());
  24. }
  25. }
  26. }
  27.  
  28. SMTP = smtp.gmail.com
  29. smtp_port = 587
  30. sendmail_from = aziz.10786@gmail.com
  31. sendmail_path ="C:sendmailsendmail.exe -t"
  32.  
  33. smtp_server=smtp.gmail.com
  34. smtp_port=587
  35. error_logfile=error.log
  36. debug_logfile=debug.log
  37. auth_username=aziz.10786@gmail.com
  38. auth_password=here is my gmail password
  39. force_sender=aziz.10786@gmail.com
  40.  
  41. A PHP Error was encountered
  42.  
  43. Severity: Warning
  44.  
  45. Message: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()
  46.  
  47. Filename: libraries/Email.php
  48.  
  49. Line Number: 1554
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement