Send email from localhost in codeigniter by Hostgator
Hello friends, today i am going to tell you how to send email by codeigniter via hostgator if you are using hostgator then following instructions would be beneficial for you. first of all create an email account relevant to domain in hostgator then go to manage email accounts then there would be a link config client email with each each email in listing then click on that link then it will give you credential how to setup email for web services.
I was using codeigniter so following code may help you:
$config = array(
'smtp_host' => 'hostname',
'smtp_user' => [email protected]',
'smtp_pass' => 'password',
'smtp_crypto' => 'ssl',
'smtp_port' => '465',
$this->email->from([email protected]', 'John Doe');
Use SSL Email Configuration Recommended option otherwise it will not work in localhost.