0

This is my code:

 $config = array(
       'protocol'  =>  'smtps',
       'smtp_host' =>  'ssl://smtps.googlemail.com',
       'smtp_user' =>  'donotreply@eezybee.com',
       'smtp_pass' =>  '******',
       'smtp_port' =>  '465',
       'mailtype'  =>  'html',
       'smtp_timeout' => '4',
       'newline'   => "\r\n"
      );
    $this->email->initialize($config);

$this->email->to('donotreply@eezybee.com');
$this->email->cc();//$this->input->post('cctxt')
$this->email->from('donotreply@eezybee.com');
$this->email->subject('Test subject');
$this->email->message('Test message');
$this->email->send();
echo  $this->email->print_debugger();

This email is going into spam box.

Chaitanya Desai
  • 333
  • 3
  • 17

1 Answers1

0

First, you have an error in the google's SMTP SERVER, it must look like

$config = array(
   'protocol'  =>  'smtp',
   'smtp_host' =>  'ssl://smtp.gmail.com',
   'smtp_user' =>  'donotreply@eezybee.com',
   'smtp_pass' =>  '******',
   'smtp_port' =>  '465',
   'mailtype'  =>  'html',
   'smtp_timeout' => '4',
   'newline'   => "\r\n"
  );
$this->email->initialize($config);

$this->email->to('donotreply@eezybee.com');
$this->email->cc();//$this->input->post('cctxt')
$this->email->from('donotreply@eezybee.com');
$this->email->subject('Test subject');
$this->email->message('Test message');
$this->email->send();
echo  $this->email->print_debugger();

Then, for this to work you must enable access for less secure apps in your google account, since you are not using OAUTH.

Enable access For less Secure Apps

Good Luck!

  • No when i am using this config aaray. Mail sending stop. My server is https so I need to use smtps. Now my issue is why it goes in spam – Chaitanya Desai Oct 07 '17 at 05:29