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())
原文地址:https://www.cnblogs.com/chengfengchi/p/12745637.html