0

What I tried:

  1. I tried using below config and generated app password

  2. I tried also updating the php.ini with below details.

    public function EmailNotifications(){

             $config = Array(
                           'protocol' => 'smtp',
                           'smtp_host' => 'ssl://smtp.googlemail.com',
                           'validation'=>TRUE,
                           'smtp_timeout'=>30,
                           'smtp_port'=> 465,
                           'smtp_user' => 'sender@gmail.com', // change it to yours
                           'smtp_pass' => 'ualxykfuomcrfsdi', // this is the app password generated
                           'mailtype' => 'html',
                           'charset' => 'iso-8859-1',
                           'wordwrap' => TRUE
                     );
    
    
    
              $this->load->library('email', $config);
              $this->email->set_newline("\r\n");
              $this->email->from('sender@gmail.com','Teradyne Online Shipment'); // change it to yours
              $this->email->to("receiver@gmail.com"); // change it to yours
              $this->email->subject('Account Request');
              $this->email->message($message);
    
               if($this->email->send())
              {
                 redirect('admin/home'); 
              }
              else
             {
              show_error($this->email->print_debugger());
             }
         }
    

Error:

enter image description here

Questions:

  1. Do I need to create a Gmail account for Business or just the personal account?
  2. Is the configuration different for XAMPP localhost?
Earl Mascetti
  • 1,278
  • 3
  • 16
  • 31
Netsker
  • 41
  • 4

0 Answers0