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: functionemail () {$ this-& amp; gt; load-& amp; gt; libra
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'] = 'phpddt1990 @ 163.com '; // write your 163 email account $ config ['smtp _ pass'] = 'phpddt; '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 ('phpddt1990 @ 163.com ', 'Hefei Emy youth volunteers consortium '); // sender $ this-> email-> to ('1970 @ qq.com '); $ this-> email-> message ('Haha, test mail '); $ 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. Creating a new file is calledEmail. php, Add$ ConfigThe array is in this file. Save the fileConfig/email. phpIt is automatically used. If you save a parameter configuration file, you do not need to use$ This-> email-> initialize ()Function to Initialize parameters