<sigh>
What "doesn't work"?
What does the web server logs say?
What does the mail server logs say?
Does the web server try to send the mail, but can't?
Does the mail server see the message but refuse to deliver it?
Does the mail server see the message but is unable to deliver it?