CI framework simple mail sending instance

Source: Internet
Author: User
This article mainly introduces the Simple Mail sending class of the CI framework, and analyzes the function definition and usage of the Mail sending class in combination with the complete instance form, for more information, see the example in this article to describe 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 ', ''); // 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.

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.