Look here. I'm not a PHP'er but it's what you need if you can run PHP scripts.
If you can run ASP script even better i'll give you mine but otherwuse just use one of those in the search results there. USing SMTP relies on your permissions and correct settings- does the server allow relay etc? it's often easier to use a big name such as hotmail, yahoo etc, their smtp is pretty reliable if you don't have your own smtp server.
Boog's