TP整合DEDECMS的邮件发送类

浏览:3034 发布日期:2013/06/11 分类:功能实现 关键字: email
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);
    }

附件 mail.class.zip ( 2.58 KB 下载:358 次 )

评论( 相关
后面还有条评论,点击查看>>