Posted by Mick Seymour on 8/23/2008, 10:36 am
64.110.90.70
Hi Sean
Testing the contact page and mail.php on Redhat Enterprise Linux 5.1, Apache V2.2.3, PHP V5.1.6 I have a problem with mail.php and some suggestions.
First, the contact form has 'From' as a label you are using as a subject field. Could we have both a 'From' being the senders real name and a 'Subject'?
Next mail.php.
1. There is a chunk of text around the $recipient variable saying to change it to your email address. Why not use the hidden recipient input field from contact.html and remove that block from the php script?
2. I was getting the invalid email message on sending. Your code setting $email and $subject using $HTTP_POST_VARS was not setting the variables. Changing it to use $_POST, as in $email = $_POST['email'] works.
3. Your 'No subject' error message is a little curt.
4. The received email was from the Apache user at the sending server. This is probably OK but you can't then hit the Reply button to answer any questions. However, the PHP mail command can take another parameter for additional mail headers which can include a From: statement. Try something like "$from = 'From: '.$email;" then do a "mail($recipient,$subject,$message,$from)". There is a potential problem with this though: the server may complain that the from domain is not allowed to relay through it. I can't test that part as I can use any from address through my server.
Message Thread:
![]()
« Back to thread