The php version of WeChat public platform implements the method of sending an email after the reservation is submitted, and then the email

Source: Internet
Author: User

The php public platform implements the method of sending an email after the reservation is submitted.

This example describes how to send an email after an appointment is submitted on the php public platform. We will share this with you for your reference. The details are as follows:

In fact, this mail is very simple. We only need to accept the email address submitted by the user, and then send the email through php mail control. The following is a comprehensive development example.

First, the yyuc framework supports sending emails. Add the following code on yyuc/yyuc. php:

require_once(YYUC_LIB.'plugin/SendMail.php');$sendMail = new SendMail();

Configure the sending function in wx conf. php. The Code is as follows:

Public static $ email = array ('reg '=> array ('protocol' => 'smtp', 'smtp _ host' => 'smtp .qq.com ', 'smtp _ user' => '', 'smtp _ pass' =>'', 'from' => array ('', 'registration information ')), 'findpwd' => array ('protocol' => 'smtp ', 'smtp _ host' => 'smtp .qq.com', 'smtp _ user' => '', 'smtp _ pass' => '', 'from' => array ('', 'password retrieval ')));

Add the following code to the corresponding location:

$ Wid = Session: get ('wid'); $ pubs = new Model ('pubs'); $ pubs-> field ('uid ') -> find (array ('id' => $ wid); $ uid = $ pubs-> uid; $ user = new Model ('micro _ car_yysj '); $ user-> field ('noticeemailon, noticeemail')-> find (array ('uid' => $ uid); $ noticeemailon = $ user-> noticeemailon; $ noticeemail = $ user-> noticeemail; if ($ noticeemailon = "1") {sendMail: normal_send ("reg", $ noticeemail, "Hello, you have a user on the system who has a test drive Reservation "," Hello, you have a user on the system who has a test drive reservation, please log on to the system to view ", $ toname = '');}

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.