Home > php教程 > php手册 > 微信公众平台预约提交后发送email例子

微信公众平台预约提交后发送email例子

WBOY
Release: 2016-05-25 16:45:34
Original
1660 people have browsed it

其实这种发送邮件是非常的简单了我们只要接受由用户提交过来的邮箱地址,然后再由php的邮件控制进行邮件发送了,下面看一个综合开发例子.

首先yyuc框架是支持发送email的,在yyuc/yyuc.php 上加上如下代码:

require_once(YYUC_LIB.'plugin/SendMail.php');
Copy after login

$sendMail = new SendMail();

在wx conf.php 下配置下发送函数,代码如下:

public static $email = array( 
    'reg'=>array('protocol'=>'smtp','smtp_host'=>'smtp.qq.com','smtp_user'=>'','smtp_pass'=>'','from'=>array('','注册信息')), 
    'findpwd'=>array('protocol'=>'smtp','smtp_host'=>'smtp.qq.com','smtp_user'=>'','smtp_pass'=>'','from'=>array('','密码找回')) 
);
Copy after login

在相应的位置加上如下代码:

// 
$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, "您好,您在系统有有预约试驾的用户", "您好,您在系统有有预约试驾的用户,请登录系统查看" ,$toname = ''); 
}
Copy after login


本文地址:

转载随意,但请附上文章地址:-)

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template