欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  php教程

TP整合DEDECMS的邮件发送类

程序员文章站 2024-02-16 11:51:04
...
DEDECMS的邮件发送类非常方便,下面大象给大家扣出来了,附件上传不了PHP的,上代码了
/*
* 邮件发送
* @param string $to 收件人邮箱,多个邮箱用,分开
* @param string $title 标题
* @param string $content 内容
*/

public function email($to,$title,$content){
import("@.ORG.Util.mail"); //导入邮件类,在附件里面
//邮件相关变量
$cfg_smtp_server = 'smtp.qq.com';
$cfg_ask_guestview = '8';
$cfg_smtp_port = '25';
$cfg_ask_guestanswer = '8';
$cfg_smtp_usermail = '222222@qq.com';//你的QQ邮箱
$cfg_smtp_user = '222222';//你的QQ号
$cfg_smtp_password = '123456';//你的QQ密码

$smtp = new smtp($cfg_smtp_server,$cfg_smtp_port,true,$cfg_smtp_usermail,$cfg_smtp_password);
$smtp->debug = false;

$mailtitle=$title;//邮件标题
$mailbody=$content;//邮件内容
//$to 多个邮箱用,分隔
$mailtype='TXT';
$smtp->sendmail($to,$cfg_webname,$cfg_smtp_usermail, $mailtitle, $mailbody, $mailtype);
}

TP整合DEDECMS的邮件发送类 mail.class.zip ( 2.58 KB 下载:316 次 )

AD:真正免费,域名+虚机+企业邮箱=0元