A simple email sending instance of the CI framework, and an email sent by the ci framework. A simple email sending class in the CI framework. the example in this article describes the simple email sending class in the ci framework. For your reference, the ci framework is definitely a simple mail sending instance of the ph CI framework, and the ci framework sends emails.
This example describes the simple email sending class of the CI framework. We will share this with you for your reference. The details are as follows:
The ci framework is definitely what php beginners want. it can greatly shorten the amount of your code!
The following is a simple demonstration of my email sending:
Function email () {$ this-> load-> library ('email '); $ config ['protocol'] = 'smtp '; $ config ['smtp _ host'] = 'smtp .163.com '; $ config ['smtp _ user'] = 'jb51 @ 163.com '; // write your 163 email account $ config ['smtp _ pass'] = 'jb51; 'here ;'; // enter your 163 email password $ config ['mailtype'] = 'HTML '; $ config ['validate'] = true; $ config ['priority '] = 1; $ config ['crlf'] = "\ r \ n"; $ config ['smtp _ port'] = 25; $ config ['charset'] = 'utf-8'; $ config ['wordwre'] = TRUE; $ this-> email-> initialize ($ config ); $ this-> email-> from ('jb51 @ 163.com ', 'Customer home'); // sender $ this-> email-> to ('2017 @ qq.com '); $ this-> email-> message ('Haha, test email send'); $ 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 in a configuration file. Create a new file called email. php and add the $ config array to the file. Save the file as config/email. php and it will be used automatically. If you save a parameter configuration file, you do not need to use the $ this-> email-> initialize () function to initialize the parameter.