Sending an Email using PHP Codeigniter

Dec 25, 2018

Simple way to Sending email in PHP - CodeIgniter. You also configure the preferences regarding email in CodeIgniter. CodeIgniter provides multiple features for sending emails.

To send an email using PHP - CodeIgniter, first you have to load codeigniter email library using the following -


After loading email library, execute the following functions to set necessary elements to send an email. The from() function is used to set - from where the email is being sent ,and to() function is used - to whom the email is being sent. The subject() and message() function is used to set the subject and message of the email what we sent.

$this->email->from('[email protected]', 'Your Name');
$this->email->to('[email protected]');
$this->email->subject('Codeigniter Email Test');
$this->email->message('Testing the Codeigniter email class.');

Copyright 2018. All rights are reserved