--- Hitesh <[EMAIL PROTECTED]> wrote: > I am new to PHP with just one month experience. I am facing > a problem with my feedback FORM PHP SCRIPT. > ========================================================= > <?php > $txtname = $_POST['txtname']; > $txtemail = $_POST['txtemail']; > $txttel = $_POST['txttel']; > $txtcity = $_POST['txtcity']; > $txtselect = $_POST['txtselect']; > $txtcomments = $_POST['txtcomments']; > > $subject = $txtselect; > $from = $txtname; > $notes = stripcslashes($notes); > > $message = "From: $txtname ($txtemail)\n > Tel No: $txttel \n > City: $txtcity \n > Type: $txtselect \n > Comments: $txtcomments \n"; > > mail("[EMAIL PROTECTED]", $subject, $message, $from); > ?> > ============================================================= > > Now the script is working fine, the only thing I want is that when I receive > the email, The FROM section in my Email Inbox should show the name of the > sender , that is 'txtname' > > Please tell me where am I wrong.
First, please don't send a question to multiple groups. Choose one and try for an answer. Next, the fourth argument of the mail() function is expecting a mail header. In this case you need to change this line: $from = $txtname; to: $from = "From: $txtname\r\n"; You may find different behavior on Unix/Linux servers and the mail servers which go with them (sendmail, qmail, postfix, exim) vs what you can do from a Windows server. The Linux ones will generally accept the From: header and use it according to the RFC standard. However, certain ways of connecting a Windows server to a mail server causes this to behave in odd ways, including ignoring this header value entirely. The \r\n is part of the standard as is the space after the colon and the capitalization of "From". James