PHP version of micro-trust public platform to achieve the appointment submitted after the method of sending email _php example

Source: Internet
Author: User

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.

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.