Extension of speedphp's rapid website development framework (I) [email sending extension]

Source: Internet
Author: User

Introduction: This is an extension of the speedphp rapid website development framework (I) detailed page of [Mail Extension]. It introduces the knowledge, skills, and experience related to PhP, and some PHP source code.

Class = 'pingjiaf' frameborder = '0' src = 'HTTP: // biancheng.dnbc?info/pingjia.php? Id = 342379 'rolling = 'no'>

Due to the needs of recent development projects, I have always wanted to search for a more practical and fast development framework. The speedphp framework was finally used for a search on the Internet. Most of the reasons for using this framework are that I am focusing on the domestic framework, because the domestic framework is relatively simple for our project developers to learn, this framework is also developed based on the smarty framework and supports many extensions.

Continue with the theme. Today, we mainly talk about the extended class of email sending. I mainly use the following methods:

Reference the extension class first.

Add the spemail extension class to the speedphp extension class folder... speedphp \ extensions.

You can download the extension class library here.

Step 2 add an extension configuration node to the configuration file

ViewCode

1 'spemail' => array (// ������������?
2 'debug' => false, // else �� else 」
3 'host _ name' => '2014. com', //?
4 'smtp _ host' => 'smtp .163.com ', // SMTP?
5 'smtp _ port' => '25', // SMTP protocol
6 'auth' => true, // call Nan.
7 'from' => 'lyyliyongyi @ 163.com ', // ��
8 'user' => 'lyyliyongyi?
9 'pass' => '20140901', // optional
10 'Log _ file' => '', //
11 'time _ out' => 30, // else ��
12 ),

Step 3: reference in the class

View code

1 $ sendemail = $ this-> spargs ("email ");
2 $ Pwd = "";
3 if (! Empty ($ sendemail ))
4 {
5 // peak traffic
6 $ condition = array ("user_name" => $ sendemail );
7 $ mail = spclass ('spemail ');
8 $ libvpnuser = spclass ('lib _ vpn_user ');
9 $ userpwd = $ libvpnuser-> Find ($ condition );
10 if ($ userpwd! = False)
11 {
12 $ Pwd = $ userpwd ["password"];
13 // Why?
14 $ mailsubject = "bjtz VPN overview"; // Huan Juan wedding
15 $ mailbody = "16 $ mailtype = "文� ��". $ PWD; // tttttml/TXT examples? What is TXT?
17 $ result = $ mail-> Sendmail ($ sendemail, $ mailsubject, $ mailbody, $ mailtype );
18 if ($ result! = False)
19 {
20
21 $ str_mess = "€ € ?;
22 $ gettag = "info ";
23}
24}
25 else
26 {
27 // Why?
28 $ str_mess = "文' ";
29 $ gettag = "error ";
30}

Love J2EE follow Java Michael Jackson video station JSON online tools

Http://biancheng.dnbcw.info/php/342379.html pageno: 6.

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.