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/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: getting problem with the in sending email with gmail (/showthread.php?tid=52682)



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' => '[email protected]',
               'smtp_pass' => 'praveenpuglia',
               'smtp_timeout' => 10
          );
          $this->load->library('email',$config);
          $this->email->setnewline("\r\n");
          $this->email->from('[email protected]','asd');
          $this->email->to('[email protected]');
          $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!