The example of this article describes the CI framework Simple Mail send class. Share to everyone for your reference, specific as follows:
The CI frame is definitely the thing that PHP beginners want, it can greatly shorten the amount of your code!
Let's take a look at a simple demo of my email:
function email ()
{
$this->load->library (' email ');
$config [' protocol '] = ' smtp ';
$config [' smtp_host '] = ' smtp.163.com ';
$config [' smtp_user '] = ' jb51@163.com '//Here Write your 163 email accounts
$config [' smtp_pass '] = ' jb51; '; /Here Write your 163-mailbox password
$config [' mailtype '] = ' html ';
$config [' Validate '] = true;
$config [' priority '] = 1;
$config [' CRLF '] = "\ r \ n";
$config [' smtp_port '] =;
$config [' charset '] = ' utf-8 ';
$config [' wordwrap '] = TRUE;
$this->email->initialize ($config);
$this->email->from (' jb51@163.com ', ' cloud-dwelling Community ');/sender
$this->email->to (' 123456789@qq.com ');
$this->email->message (' Haha, test mail sent ');
$this->email->send ();
echo $this->email->print_debugger ();
}
If you do not want to use the above method to set parameters, you can put them into a configuration file. Create a new file called email.php, add the $config array in the file. Then save the file as config/email.php and it will be used automatically. If you save a parameter profile, you do not need to use the $this->email->initialize () function to initialize the parameter.
More interested in CodeIgniter related content readers can view the site topics: "CodeIgniter Introductory Course", "CI (CodeIgniter) Framework Advanced Course", "PHP Excellent Development Framework Summary", "thinkphp Introductory Course", " Thinkphp Common Methods Summary, "Zend Framework Introduction Course", "PHP object-oriented Programming Introduction Course", "Php+mysql Database operation Introduction Tutorial" and "PHP common database Operation Skills Summary"
I hope this article will help you with the PHP program design based on CodeIgniter framework.