phpmailer配置qq邮箱

    function send_email2($email = '*****@perspectivar.com'){
        $this->autoRender = false;
        date_default_timezone_set('PRC');
        require "../Lib/mail/class.smtp.php";  // 引入smtp核心类
        require "../Lib/mail/class.phpmailer.php"; // 引入PHPMailer核心类
        $mail = new PHPMailer;
        $mail->CharSet = "UTF-8";
        $mail->isSMTP();
        $mail->SMTPAuth=true;
        $mail->SMTPKeepAlive=true;
        $mail->SMTPSecure= "ssl";
        $mail->Host="smtp.qq.com";
        $mail->Port=465;
        $mail->Username = "9*****67";
        $mail->Password = "ito***hqxmbffi";
        $mail->From="93***067@qq.com";
        $mail->FromName="慧慧";
        $mail->WordWrap=50;
        $mail->addReplyTo('replyto@example.com', 'First Last');
        $mail->addAddress($email, '尊敬的客户');
        $mail->Subject = '出入金通知!';
        $mail->msgHTML('有出入金待您审批!');
        if (!$mail->send()) {
            echo $this->output(false,"Mailer Error: " . $mail->ErrorInfo);
        } else {
            echo $this->output(true,"Message sent!");
        }
    }

 

posted on 2018-06-26 23:36  薇薇123456  阅读(122)  评论(0编辑  收藏  举报

导航