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 = '');}