I haven't messed with php for so long I forget the exact syntax and functions but I'm sure wherever you got that they cut out sections of code for "script kiddies". Its obvious what it does but I believe Moonbat is right with the fopen. A section of code is definitely missing from there and you may be missing something at the end where the mail function is. Php is usually very simple and this script is very basic that looking up the function in the php homepage or help file and making sure the web server supports that php version and it should work. I'm sure you know to fill in the variables asking for your own info. Anyway good luck with this and if you really can't figure it out post back and I'll look some shit up for you.