Skip to content

Instantly share code, notes, and snippets.

@arbaaz
Created January 27, 2014 10:19
Show Gist options
  • Save arbaaz/8646234 to your computer and use it in GitHub Desktop.
Save arbaaz/8646234 to your computer and use it in GitHub Desktop.
Send email from codeigniter
public function index()
{
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'smtp3.netcore.co.in',
'smtp_port' => 25,
'smtp_user' => '[email protected]',
'smtp_pass' => 'Supp0rt',
'mailtype' => 'html',
'charset' => 'utf-8',
'wordwrap' => TRUE
);
$this->load->library('email',$config);
$this->email->from('[email protected]', 'Support');
$this->email->to('[email protected]');
$this->email->cc('');
$this->email->bcc('');
$this->email->subject('Test');
$this->email->message('This is a test email');
if ( ! $this->email->send())
{
// Generate error
echo "Email is not sent!!";
}
echo $this->email->print_debugger();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment