php - Why sending email is not working in codeigniter? -


i sending email using codeigniter version 2.2.1 . giving me error . please tell me why ? here php code .

       $config = array(             'protocol'=>'smtp',             'smtp_host'=>'ssl://smtp.googlemail.com',             'smtp_port'=>465,             'smtp_user'=>'xxx@gmail.com',             'smtp_pass'=>'xxx'         );          $this->load->library('email',$config);          $this->email->set_newline("\r\n");         $this->email->from('xxx@gmail.com', "my name");         $this->email->to($to);         $this->email->subject($subject);         $this->email->message($message);         $this->email->send();         return $this->email->print_debugger(); 

but when send . giving me error . please why ? tried many ways . not working . why ?

   220 smtp.gmail.com esmtp ci2sm13227458pbc.66 - gsmtp  hello: 250-smtp.gmail.com @ service, [61.4.76.240] 250-size 35882577 250-8bitmime 250-starttls 250-enhancedstatuscodes 250-pipelining 250-chunking 250 smtputf8  failed send auth login command. error: 530 5.7.0 must issue starttls command first. ci2sm13227458pbc.66 - gsmtp  from: 530 5.7.0 must issue starttls command first. ci2sm13227458pbc.66 - gsmtp  following smtp error encountered: 530 5.7.0 must issue starttls command first. ci2sm13227458pbc.66 - gsmtp  to: 530 5.7.0 must issue starttls command first. ci2sm13227458pbc.66 - gsmtp  following smtp error encountered: 530 5.7.0 must issue starttls command first. ci2sm13227458pbc.66 - gsmtp  data: 530 5.7.0 must issue starttls command first. ci2sm13227458pbc.66 - gsmtp  following smtp error encountered: 530 5.7.0 must issue starttls command first. ci2sm13227458pbc.66 - gsmtp 502 5.5.1 unrecognized command. ci2sm13227458pbc.66 - gsmtp following smtp error encountered: 502 5.5.1 unrecognized command. ci2sm13227458pbc.66 - gsmtp unable send email using php smtp. server might not configured send mail using method.  user-agent: codeigniter date: thu, 15 oct 2015 08:45:28 +0200 from: "war" <iljimae.ic@gmail.com> return-path: <iljimae.ic@gmail.com> to: iljimae.ic@gmail.com subject: =?utf-8?q?subject?= reply-to: "iljimae.ic@gmail.com" <iljimae.ic@gmail.com> x-sender: iljimae.ic@gmail.com x-mailer: codeigniter x-priority: 3 (normal) message-id: <561f4b884c5d7@gmail.com> mime-version: 1.0   content-type: text/plain; charset=utf-8 content-transfer-encoding: 8bit  every find bro ? here u . 

i using localhost xampp . need configure in localhost please ?

try this:

public function some_name() {      $email = $this->input->post('email');      $config = array(         'protocol' => 'smtp',         'smtp_host' => 'ssl://smtp.googlemail.com',         'smtp_port' => 465,         'smtp_user' => '*****@gmail.com',         'smtp_pass' => '*****',         'mailtype'  => 'html',          'charset' => 'utf-8',         'wordwrap' => true     );                  /*      *     * send email #temp_pass link     *     */      $this->load->library('email', $config);     $this->email->set_newline("\r\n");     $this->email->from('****@gmail.com', "****");     $this->email->to($email);     $this->email->subject("***********");      $message = "<p>your account ************</p>";     $this->email->message($message);     $result = $this->email->send();  } 

Comments

Popular posts from this blog

javascript - Chart.js (Radar Chart) different scaleLineColor for each scaleLine -

apache - Error with PHP mail(): Multiple or malformed newlines found in additional_header -

java - Android – MapFragment overlay button shadow, just like MyLocation button -