I am using CodeIgniter to send Email using this code:
$config['protocol'] = "smtp";
$config['smtp_host'] = "mail.******.com";
$config['smtp_port'] = "25";
$config['smtp_user'] = "****@****.com";
$config['smtp_pass'] = "*****";
$config['charset'] = "utf-8";
$config['mailtype'] = "html";
$config['send_multipart'] = \r\n;
$config['crlf'] = "\r\n";
$this->email->initialize($config);
$this->email->set_newline("\r\n");
And it succeeds when I run on an online server (public hosting).
But I got the following error when I executed the code on my own server in local.
Failed to send AUTH LOGIN command. Error:
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
User-Agent: CodeIgniter
is there any error on my code or the server config?