Google trends Public Holidays Coupon Code Code Compiler

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 -


$this->load->library('email');

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('your-email@sample.com', 'Your Name');
$this->email->to('someone-email@sample.com');
 
$this->email->subject('Codeigniter Email Test');
$this->email->message('Testing the Codeigniter email class.');
$this->email->send();

Copyright 2024. All rights are reserved