}
        } else {
            sleep(DELAY_SEC);
            echo json_encode(array("status" => 0, "count" => 0, "result" => "报名失败!"));
            return;
        }
        $str_query4 = "update trainees set Status = {$newStatus}, ExamineUser = '******' where  TrainingId = {$TrainingId} and UserId = {$UserId} and Status = {$Status}";
        if (mysqli_query($link, $str_query4)) {
            $str_log = "Insert into log (UserId,FunctionName,ActionName,ActionTime,ActionReturn,ActionObject)" . " VALUES('{$UserId}','报名审核','审核同意',now(),'{$user_id}','{$TrainingId}')";
            if (!mysqli_query($link, $str_log)) {
                echo -__LINE__ . $str_log;
                mysqli_close($link);
                return;
            }
            echo "0";
            mysqli_close($link);
            $emailsmtp = new EmailSmtp();
            foreach ($emaillist as $el) {
                $emailsmtp->eSmtp($el);
            }
            return;
        } else {
            if ($link) {
                mysqli_close($link);
            }
            sleep(DELAY_SEC);
            echo -__LINE__;
            return;
        }
    }
}
Пример #2
0
        $smtpserver = "smtp.ym.163.com";
        //163邮箱服务器端口
        $smtpserverport = 25;
        //你的163服务器邮箱账号
        $smtpusermail = "*****@*****.**";
        //收件人邮箱
        $smtpemailto = $email;
        //"*****@*****.**";
        //你的邮箱账号(去掉@163.com)
        $smtpuser = "******";
        //SMTP服务器的用户帐号
        //你的邮箱密码
        $smtppass = "******";
        //SMTP服务器的用户密码
        //邮件主题
        $mailsubject = "测试邮件发送";
        //$mailsubject = '=?UTF-8?B?'.base64_encode($mailsubject).'?=';
        //邮件内容
        $mailbody = "<p>PHP+MySQL测试邮件发送</p><p><a href=\"http://baidu.com\">baidu</a>";
        //邮件格式(HTML/TXT),TXT为文本邮件
        $mailtype = "HTML";
        //这里面的一个true是表示使用身份验证,否则不使用身份验证.
        $smtp = new smtp($smtpserver, $smtpserverport, true, $smtpuser, $smtppass);
        //是否显示发送的调试信息
        $smtp->debug = TRUE;
        //发送邮件
        $smtp->sendmail($smtpemailto, $smtpusermail, $mailsubject, $mailbody, $mailtype);
    }
}
$emailsmtp = new EmailSmtp();
$emailsmtp->eSmtp("*****@*****.**");