This article describes the PHP version of micro-trust public platform for the implementation of the appointment to send email after the method. Share to everyone for your reference, specific as follows:
In fact, this kind of sending mail is very simple, we just accept the user submitted by the email address, and then by the Mail control of PHP mail sent, the following look at a comprehensive development example.
First YYUC framework is to support sending email, add the following code on yyuc/yyuc.php:
Require_once (yyuc_lib. ' plugin/sendmail.php ');
$sendMail = new SendMail ();
Under WX conf.php, configure the Send function under the following code:
public static $email = Array ('
reg ' =>array (' protocol ' => ' SMTP ', ' Smtp_host ' => ' smtp.qq.com ', ' smtp_user ' = > ', ' Smtp_pass ' => ', ' From ' =>array (', ' registered information '),
' findpwd ' =>array (' protocol ' => ' SMTP ', ' SMTP_ Host ' => ' smtp.qq.com ', ' smtp_user ' => ', ' smtp_pass ' => ', ' From ' =>array (' password recovered '))
;
Add the following code to the appropriate 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 are in the system have an appointment test drive users", "Hello, you in the system has an appointment test drive users, Please login to System view ", $toname = ');
For more information on PHP related content readers can view the site topics: "PHP micro-credit Development Skills summary", "PHP coding and transcoding Operation skills Summary", "PHP Network Programming Skills Summary", "PHP basic Grammar Introductory Course", "PHP string (String) Usage Summary", "php+ MySQL Database operations Introduction tutorial and PHP Common database operation Skills Summary
I hope this article will help you with the PHP program design.