0

I have configured php.ini, sendmail.ini and also used the right port and configuration for gmail, I also enable lesssecure apps on gmail but I could see mail when i check inbox and it shows no error

Here's the controller

                   $config['protocol'] = 'smtp';
                    $config['smtp_host'] = 'ssl://smtp.googlemail.com';
// SMTP Port - the port that you is required
$config['smtp_port'] = 465;
$config['smtp_user'] = $sender_email;
$config['smtp_pass'] = $sender_password;
$this->load->library('email', $config);
$this->email->from($sender_email);
$this->email->to($to_email);
$this->email->subject($subject);
$this->email->message($message);
                    if(!$this->email->send()) {
                        show_error($this->email->print_debugger());
                    }
                    else{
                        echo 'Your email has been sent!<br/>';
                    }

                echo $message2; //send this in email

php.ini

extension=php_openssl.dll

sendmail.ini

smtp_server=smtp.gmail.com
smtp_port=465
auth_username= xxxx.gmail.com
auth_password= xxxx
N. francis
  • 75
  • 1
  • 12

1 Answers1

0

You can use below tool to test emails on localhost. Setup is rather easy and clearly explained in the description. Test Mail Server Tool

Ali Niaz
  • 312
  • 3
  • 10