First of all, last parameter should have the form
"$header: $header_valie"
, it cannot possibly be
"From: $Name <$comments>"
. Also, I have no evidence that your mail is properly setup, that all parameter values are correct, and so on. To start with, make sure that some existing mail client can send mail with the same parameters and the same SMTP server (or whatever you use at your Web site's host). Check up everything.
It's very good that it does not send mail yet. You are going to face much worse problem. The way your code is written will
allow anyone to turn your host into a zombie sending spam, or something like that. It can be done
in no time through the simplest
injection trick; and you won't even notice that.
For further explanation, please see my past answer and fix it, through proper sanitizing of the input which comes from your HTTP request:
unable to send mail , it showing the error in below code .[
^].
—SA