Make sure your SMTP server is up and running. I tested mine using Outlook express and found that it would not relay any messages. So the problem wasnt the code. Here is how I fixed it.
Go to control pannel, administrative tools and click on the IIS icon.
Right click and selct properties for the Default SMTP Virtual Server.
Select the Acess tab and click on the Relay button.
Select Only the list below, click the add button, select domain and type in localhost or select 'All except the list below' ('All except the list below' is Ok for trouble shooting but this may allow people to use your mail server to spam)
That fixed my problem. Again I'd recomend testing the mail server using Outlook express or some other mail client to make sure your SMTP server is working properly. Reply and let me know if this worked for you.