CodeIgniter Forums
getting problem with the in sending email with gmail - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forum-20.html)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forum-23.html)
+--- Thread: getting problem with the in sending email with gmail (/thread-52682.html)



getting problem with the in sending email with gmail - El Forum - 06-21-2012

[eluser]Unknown[/eluser]
Hello Sir, I am continuously getting error with the code,I checked your from and googled a lot but didn't find anything wrong. Please guide me to solve this problem.
here is the code:-

Code:
<?php
  /* SENDING EMAIL WITH GAMIL */
  class Email extends CI_Controller {
      function _construct() {
          parent::Controller();
      }
      function index() {
          $config = array (
               'protocol' => 'smtp',
               'smtp_host' => 'ssl://smtp.googlemail.com',
               'smtp_port' => 465,
               'smtp_user' => 'sorrakowah@gmail.com',
               'smtp_pass' => 'praveenpuglia',
               'smtp_timeout' => 10
          );
          $this->load->library('email',$config);
          $this->email->setnewline("\r\n");
          $this->email->from('sorrakowah@gmail.com','asd');
          $this->email->to('sorrakowah@gmail.com');
          $this->email->subject('checking this mail');
          $this->email->message('yee...i win');
          if($this->email->send()){
              echo 'mail sent';
          }
          else  show_error($this->email->print_debugger());
      }
  }
?>

solved........ Smile


getting problem with the in sending email with gmail - El Forum - 06-21-2012

[eluser]iainco[/eluser]
You might want to change your gmail password since you posted it in your code snippet!