php phpmailer

        $mail = new PHPMailer(true);                                // Enable verbose debug output
        $mail->isSMTP(); 
        $mail->SMTPDebug = 0;                                     // Set mailer to use SMTP
        $mail->Host = 'smtp.qq.com';  // Specify main and backup SMTP servers
        $mail->SMTPAuth = true;                               // Enable SMTP authentication
        $mail->Username = '*****@qq.com';                // SMTP 用户名  即邮箱的用户名
        $mail->Password = '*****';             // SMTP 密码  部分邮箱是授权码(例如163邮箱)
        $mail->SMTPSecure = 'ssl';                            // Enable TLS encryption, `ssl` also accepted
        $mail->Port = 465;
        $mail->Mailer = "smtp";                                    // TCP port to connect to
        $mail->setFrom('****@qq.com', '姓名');
        $mail->addAddress($mail_address, '姓名');     // Add a recipient
        $mail->isHTML(true);                                  // Set email format to HTML
        $mail->Subject = '程序报错';
        $mail->Body    = $content;
    
        if($mail->send())

 

posted @ 2020-04-21 16:42  酷酷的城池  阅读(154)  评论(0编辑  收藏  举报