check the following -
- check if your smtp server is running (you could either check through command line tools or try ftp'ing to port 25).
- If your smtp server is running. Then try to send a mail manually (without script). Use the command-line mail command (I am assuming you have unix here).
Also, when you run your script, what happens? It could be possible that your mail is in a Queue. From your terminal type 'mailq'. This shows the current emails in Queue & why they are there. Also there is a corresponding log to this. You could also check that out for info.
My guess is if all the above are running, you are good to go.