Re: Emailing the results of form entry NOT working
| From: | Richard Lynch | Date: | Fri, 03 Aug 2001 02:25:04 +0000 |
| Subject: | Re: Emailing the results of form entry NOT working | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-61061@lists.php.net to get a copy of this message | ||
> <html>
> </html>
>
> <?
> if(!$submit) {
> header("Location:
> http://www.imsltd.com/feedback.html");
Why redirect? That's just going to infinitely send you back to the FORM
above, no?...
Just put
exit;
here.
> }
> $to = "support@imsltd.com";
> $subject = "Feedback";
> $mail_body = "Feedback From Your Site\n";
> $mail_body .= "Sender's Name: $name\n";
> $mail_body .= "Sender's E-Mail: $email\n";
> $mail_body .= "Feedback: $feedback\n\n";
> $mail_headers = "From: My Web Site <> \n";
> $mail_headers .= "Reply-To: $sender_email\n\n";
> mail($mail_to, $mail_subject, $mail_body, $mail_headers);
Everywhere you have \n you should have \r\n to be RFC-compliant. Most Un*x
boxes won't care. Windows boxes will puke on you.
Your subject is $subject, not $mail_subject as well, and B. already pointed
out to/mail_to