Home>

The ci framework is definitely what i want in php beginners,It can greatly reduce your code size!

Let's take a look at my simple demonstration of sending mail:

function email ()
{
   $this->load->library ("email");
   $config ["protocol"]="smtp";
   $config ["smtp_host"]="smtp.163.com";
   $config ["smtp_user"]="[email protected]";//Write your 163 email account here
   $config ["smtp_pass"]="jb51;";//Write your 163 email password here
   $config ["mailtype"]="html";
   $config ["validate"]=true;
   $config ["priority"]=1;
   $config ["crlf"]="\ r \ n";
   $config ["smtp_port"]=25;
   $config ["charset"]="utf-8";
   $config ["wordwrap"]=true;
   $this->email->initialize ($config);
   $this->email->to ("[email protected]");
   $this->email->message ("Haha, test mail sending");
   $this->email->send ();
   echo $this->email->print_debugger ();
}

If you do n’t want to set parameters using the methods above,You can put them in a configuration file.Create a new file called email.php and add the $config array in that file.Then save the file as config/email.php and it will be used automatically.If you save a parameter profile,There is no need to use the $this->email->initialize () function to initialize parameters

php
  • Previous JS + Canvas achieves rain and snow effect
  • Next 63 Manipulating Data in ASPNET 20: GridView Implements Batch Delete Data