Posted by Sean McCormack on 8/24/2008, 8:13 pm, in reply to "R5 Mail"
87.192.101.62
--Previous Message--
: 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'?
We could for sure...
:
: 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?
:
Because it shows in the html and is harvestable by bots.
: 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.
Okay, I'll try that, although I've not had an issue with it here.. but someone else has.. What's the difference?
:
: 3. Your 'No subject' error message is a
: little curt.
I've actually already changed that, you'll be glad to hear
:
: 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.
:
I know, but the problem is that it's going to be used on many servers where the user has no control over php settings.. what happens then?
Great suggestions Mick.
Message Thread:
![]()
« Back to thread