+ 1

can't send email using Code ignitor email library

<?php class Email extends CI_Controller { function __construct() { parent::__construct(); $this->load->helper('form'); } function index() { $this->load->helper('form'); $this->load->view('example22)/email_view', array('error'=>'')); $this->load->library('email'); $config = array(); $config['protocol'] = 'smtp'; $config['smtp_host'] = 'localhost'; $config['smtp_user'] = 'root'; $config['smtp_pass'] = ''; $config['smtp_port'] = 25; $this->email->initialize($config); $from = ' praj5354@gmail.com'; $name = "saurav"; $to = 'praj5354@gmail.com'; $subject = "testing email"; $message = "This email is sent through the CI"; $this->email->from($from,$name); $this->email->to($to); $this->email->subject($subject); $this->email->message($message); if($this->email->send()) { $this->load->view('example22)/email_success'); } else { echo("Failed to send email".$this->email->print_debugger()) ; } } } ?> // I have checked the default configuration and setting my own . But i can't send. It shows an 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. " please help

22nd May 2018, 6:53 AM
Saurav Kumar
Saurav Kumar - avatar
1 ответ
0
yo utilizo sengrid, es muy sencillo integrarlo en CodeIgniter
8th Jun 2018, 5:30 AM
Pablo Gabriel Velasquez Gonzalez
Pablo Gabriel Velasquez Gonzalez - avatar