in reply to Contact Form 2

First check that your path is correct to the sendmail. That's not the path to mine, and if you are typing this out of a book, its probably not the path your ISP has. Check.. make sure

Second, check that the user you have sending the email exists on the sever. You have admin@yourhost.com Make sure "admin" is a user, most ISP's won't allow you to send email from a non-existant account, to keep spamming down.

Third " or die" is a valid end to a program. Have it log something on the die, so you got some kind of message to refer to. Nothing is being returned, so debugging something like this will be a bear if you don't get some type of responce from the program that everything went well, or what might have gone wrong.

I rarely use || die on cgi's .. I have them log or return an error code. This keeps things nice and simple to maintain later.

Lastly.. I don't think those single quotes should be there. I'm not sure why they are there, and I would try removing them. Change
print MAIL "Name: $formdata{'name'}\n"; print MAIL "email: $formdata{'email'}\n"; print MAIL "message: $formdata{'message'}\n";
to this
print MAIL "Name: $formdata{name}\n"; print MAIL "email: $formdata{email}\n"; print MAIL "message: $formdata{message}\n";


Hope that helps.

Glenn H.

Replies are listed 'Best First'.
Re: Re: Contact Form 2
by Juerd (Abbot) on Mar 25, 2002 at 08:33 UTC

    Lastly.. I don't think those single quotes should be there. I'm not sure why they are there, and I would try removing them.

    A hash key is a string, so it can be quoted. It's actually an exception to strict's strictness that you can do without quotes (only if it's a valid unquoted string, of course (/^\w+\z/). Same goes for =>'s left operand. Without strict, you can use unquoted strings everywhere (but don't drop strict, and don't use unquoted strings when not a hash key, or =>'s left operand).

    /me prefers literal hash keys quoteless.

    U28geW91IGNhbiBhbGwgcm90MTMgY
    W5kIHBhY2soKS4gQnV0IGRvIHlvdS
    ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
    geW91IHNlZSBpdD8gIC0tIEp1ZXJk