@ is a php option that tells PHP NOT to send an error message on failure.
@fopen -- Don't send the "WARNING Failed to open file in index.php line 5"
etc.
Comment out the @ == just use mail(
you can get a clue then if you get an error message.
My guess is that this prebuilt script has a sendmail server parameter that you should look for. Set it to your server's sendmail address.