Sending Mail with PHP

From: Date: Thu, 06 May 2004 15:31:24 +0000
Subject: Sending Mail with PHP
Groups: php.general 
Request: Send a blank email to php-general+get-185534@lists.php.net to get a copy of this message
Hey Everyone, I've got a problem with a mail program I'm using. If you go to http://www.functionjunkie.org/contactform/contactform.php and fill out the form, it sends the email ok, but its supposed to redirect to a preset page, which it does. However, the page it redirects to is blank, except for the background image that is referenced in the CSS stylesheet. Feel free to test it as many times as you would like. I'm missing something here, but I cannot figure out what. Here's the code on feedback.php, which does the processing of the form on the contactform.php page. <? // $mailto - sets the email address the form // sents email to, eg // $mailto = "youremailaddress@example.com" ; $mailto = 'iam@functionjunkie.org' ; // $subject - sets the Subject line of the email, eg //$subject = "Feedback Form" ; $subject = "feedback from functionjunkie.org" ; // any pages that need to be displayed for form processing reasons, eg //$formurl = "http://www.example.com/feedback.html" ; //$errorurl = "http://www.example.com/error.html" ; //$thankyouurl = "http://www.example.com/thankyou.html" ; $formurl = "http://www.functionjunkie.org/contactform/contactform.php" ; $errorurl = "http://www.functionjunkie.org/contactform/error.php" ; $thankyouurl = "http://www.functionjunkie.org/contactform/thanks.php" ; $name = $_POST['name'] ; $email = $_POST['email'] ; $comments = $_POST['comments'] ; $http_referer = getenv( "HTTP_REFERER" ); $http_user_agent = getenv( "HTTP_USER_AGENT" ); $remote_host = getenv( "REMOTE_HOST" ); if (!isset($_POST['email'])) { header( "Location: $thankyouurl" ); exit ; } if (empty($name) || empty($email) || empty($comments)) { header( "Location: $errorurl" ); exit ; } $messageproper = // this is what the recipient will see when they receive the email "Hi Justin:\n $comments\n ---------------------------------------------- Details of the message sent:\n Name: $name Email: $email From: $http_referer Using: $http_user_agent Remote Host: $remote_host . "" ; mail($mailto, $subject, $messageproper, "From: \"$name\" <$email>\nReply-To: \"$name\" <$email>\nX-Mailer: FunctionJunkie WebMailer" );
    exit ;
?> Any suggestions would be appreciated. Thanks in Advance, -- Justin Kozuch - Team Macromedia Volunteer for Dreamweaver MX 2004 http://www.macromedia.com/support/forums/team_macromedia/index.html CommunityMX Partner - http://www.communitymx.com Dreaming in TO, Founder - http://www.dreaminginto.com

« previous php.general (#185534) next »