Home > Backend Development > PHP Tutorial > CI framework simple email sending class example, ci framework email sending_PHP tutorial

CI framework simple email sending class example, ci framework email sending_PHP tutorial

WBOY
Release: 2016-07-12 08:52:10
Original
881 people have browsed it

CI framework simple email sending class example, ci framework email sending

This article describes the CI framework simple email sending class example. Share it with everyone for your reference, the details are as follows:

The CI framework is definitely what you want when you are a beginner in PHP. It can greatly shorten the amount of your code!

Look at my simple demonstration of sending an email below:

function email()
{
   $this->load->library('email');
   $config['protocol'] = 'smtp';
   $config['smtp_host'] = 'smtp.163.com';
   $config['smtp_user'] = 'jb51@163.com';//这里写上你的163邮箱账户
   $config['smtp_pass'] = 'jb51;';//这里写上你的163邮箱密码
   $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->from('jb51@163.com', '帮客之家');//发件人
   $this->email->to('123456789@qq.com');
   $this->email->message('哈哈,测试邮件发送');
   $this->email->send();
   echo $this->email->print_debugger();
}

Copy after login

If you don’t want to set parameters using the above method, you can put them into a configuration file. Create a new file called email.php and 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 configuration file, you do not need to use the $this->email->initialize() function to initialize the parameters

Readers who are interested in more CodeIgniter related content can check out the special topics of this site: "codeigniter introductory tutorial", "CI (CodeIgniter) framework advanced tutorial", "php excellent development framework summary", "ThinkPHP introductory tutorial", "Summary of Common Methods in ThinkPHP", "Introduction Tutorial on Zend FrameWork Framework", "Introduction Tutorial on PHP Object-Oriented Programming", "Introduction Tutorial on PHP MySQL Database Operation" and "Summary of Common PHP Database Operation Skills"

I hope this article will be helpful to everyone’s PHP program design based on the CodeIgniter framework.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1127852.htmlTechArticleCI framework simple email sending class example, ci framework email sending example. This article describes the CI framework simple email sending class. Share it with everyone for your reference, the details are as follows: The ci framework is definitely ph...
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template