The mail function suddenly no longer works and it did not give any kind of error “localhost”

enter code here
    $receiver = "****@*****.com";
    $subject = "----";
    $body = "-----------";
    $sender = "From:****@gmail.com";
    mail($receiver, $subject, $body, $sender)

Note
Yesterday I did a speed test and sent 1000 emails after this process, the function stopped working. Could this topic be related. To remind you that I work (localhost)