David,
I took the liberty of assuming that you were trying to send email from a HTML form on a web page, even though your code had no HTTP request, as Tanmaya correctly pointed out.
Does your client want someone to fill out a form on their web site and have the information sent to them via...