Google News
logo
CodeIgniter - Interview Questions
Explain CodeIgniter E-mail library. How to send an E-mail using CodeIgniter?
* Features of Email Class in CodeIgniter are given below:
* Multiple protocols such as Mail, Sendmail, and SMTP
* TLS and SSL Encryption for SMTP
* CC and BCCs
* Multiple recipients
* Attachments
* HTML or Plain-text email
* Priorities
* Word wrapping
* BCC Batch Mode, enabling larger e-mail lists to be broken into smaller BCC batches
* Email Debugging tools

Sending Email :
Sending an email is a simple process here. You can configure an email on the fly or set your preferences in the app/Config/Email.php file. A basic example for demonstrating how you might send email is given below:
$email = \Config\Services::email();
$email->setFrom('your@interviewbit.com', 'Your Name');
$email->setTo('someone@interviewbit.com');
$email->setCC('another@another-example.com');
$email->setBCC('them@their-example.com');
$email->setSubject('Email Test');
$email->setMessage('Testing the email class.');
$email->send();​
Advertisement