A simple demonstration of CI framework email sending

Source: Internet
Author: User
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

 


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.