CI Framework Simple Mail Send class instance _php instance

Source: Internet
Author: User

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.