0

I have the below code for sending email, and on this I am getting SMTP error.

The following SMTP error was encountered: 10060 A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

Unable to send data: AUTH LOGIN

It is a very long error I have just provided the upper part.

CODE.

$frommail            = "sharadrsoni@gmail.com";
$config['protocol']  = 'smtp';
$config['smtp_host'] = 'ssl://smtp.gmail.com';
$config['smtp_port'] = '465';
$config['smtp_user'] = 'sharadrsoni@gmail.com';
$config['smtp_pass'] = 'pass'; //your smtp password
$config['mailtype']  = 'html';
$config['charset']   = 'iso-8859-1';
$config['wordwrap']  = TRUE;
$config['newline']   = "\r\n";

$this->email->initialize($config);
$this->email->from($frommail, $companyfullname);
$this->email->to($tomail);
$this->email->subject($subject);
$this->email->set_mailtype('html');
$this->email->message($MHtml);

$emailSent = $this->email->send();

I have tried couple of ways but ended showing this error only.

I am using CodeIgniter version: 2.1.0

Sachin PATIL
  • 745
  • 1
  • 9
  • 16
Sharad Soni
  • 378
  • 1
  • 5
  • 18

0 Answers0