public function send_mail()
{
$this->CI->load->library('email');
$config = array(
'protocol' => 'smtp',
'smtp_host' => 'smtpauth.net4india.com',
'smtp_port' => 587,
'smtp_user' => 'xxxxx@my_domain.in',
'smtp_pass' => 'xxxxxxxx',
'newline' => '\r\n',
'mailtype' => 'html',
'charset' => 'utf-8'
);
$this->CI->email->initialize($config);
$this->CI->email->set_mailtype("html");
$this->CI->email->set_newline("\r\n");
$this->CI->email->from('info@my_domain.in', 'My Domain');
$this->CI->email->to('xxxx@gmail.com');
$this->CI->email->subject("Test Subject");
$this->CI->email->message('Test Content');
if(!$this->CI->email->send())
{
$error = $this->CI->email->print_debugger();
echo "<pre>"; print_r($error); echo "</pre>"; exit;
return false;
}
return true;
}
I have my domain and email registered to net4india.com, and hosting at godaddy.
Using the above code i'm able to send mail from my localhost but not able to send from godaddy server.
I have added mx records in godaddy hosting. Changed the routing to remote manager.
I did lots of googling still ends up with no solution.