PHP Feedback Form not sending e-mail! Please help.

  • SigmaSquared
  • Novice
  • Novice
  • SigmaSquared
  • Posts: 23

Post 3+ Months Ago

Hi guys,

I'm using a php feedback form script i got on the web and somehow, it doesn't send me the e-mail it is supposed to. I've tried using my hotmail and my gmail account and none of them work. Here's the script i'm using:

Code: [ Select ]
<?
/*
  CHFEEDBACK.PHP Feedback Form PHP Script Ver 2.02.
  Generated by thesitewizard.com's Feedback Form Wizard.
  Copyright 2000-2004 by Christopher Heng. All rights reserved.
  thesitewizard and thefreecountry are trademarks of Christopher Heng.

  $Id: phpscript.txt 3.3 2004/06/18 11:33:40 chris Exp $

  Get the latest version, free, from:
    http://www.thesitewizard.com/wizards/feedbackform.shtml

  You can contact me at:
    http://www.thesitewizard.com/feedback.php

  LICENCE TERMS
  
  1. You may use this script on your website, with or
  without modifications, free of charge.
  
  2. You may NOT distribute or republish this script,
  whether modified or not. The script is meant for your
  personal use on your website, and can only be
  distributed by the author, Christopher Heng.
  
  3. THE SCRIPT AND ITS DOCUMENTATION ARE PROVIDED
  "AS IS", WITHOUT WARRANTY OF ANY KIND, NOT EVEN THE
  IMPLIED WARRANTY OF MECHANTABILITY OR FITNESS FOR A
  PARTICULAR PURPOSE. YOU AGREE TO BEAR ALL RISKS AND
  LIABILITIES ARISING FROM THE USE OF THE SCRIPT,
  ITS DOCUMENTATION AND THE INFORMATION PROVIDED BY THE
  SCRIPTS AND THE DOCUMENTATION.

  If you cannot agree to any of the above conditions, you
  may not use the script.
  
  Although it is NOT required, I would be most grateful
  if you could also link to thesitewizard.com at:

    http://www.thesitewizard.com/

*/

// ------------- CONFIGURABLE SECTION ------------------------

// $mailto - set to the email address you want the form
// sent to, eg
//$mailto        = "youremailaddress@example.com" ;

$mailto = 'rkhetia@hotmail.com' ;

// $subject - set to the Subject line of the email, eg
//$subject    = "Feedback Form" ;

$subject = "Feedback Form" ;

// the pages to be displayed, eg
//$formurl        = "http://www.example.com/feedback.html" ;
//$errorurl        = "http://www.example.com/error.html" ;
//$thankyouurl    = "http://www.example.com/thankyou.html" ;

$formurl = "http://bynet.freeprohost.com/feedback/feedback.html" ;
$errorurl = "http://bynet.freeprohost.com/feedback/error.html" ;
$thankyouurl = "http://bynet.freeprohost.com/feedback/thankyou.html" ;

// -------------------- END OF CONFIGURABLE SECTION ---------------

$name = $_POST['name'] ;
$email = $_POST['email'] ;
$comments = $_POST['comments'] ;
$http_referrer = getenv( "HTTP_REFERER" );

if (!isset($_POST['email'])) {
    header( "Location: $formurl" );
    exit ;
}
if (empty($name) || empty($email) || empty($comments)) {
  header( "Location: $errorurl" );
  exit ;
}
if (get_magic_quotes_gpc()) {
    $comments = stripslashes( $comments );
}

$messageproper =

    "This message was sent from:\n" .
    "$http_referrer\n" .
    "------------------------- COMMENTS -------------------------\n\n" .
    $comments .
    "\n\n------------------------------------------------------------\n" ;

mail($mailto, $subject, $messageproper, "From: \"$name\" <$email>\nReply-To: \"$name\" <$email>\nX-Mailer: chfeedback.php 2.02" );
header( "Location: $thankyouurl" );
exit ;

?>
  1. <?
  2. /*
  3.   CHFEEDBACK.PHP Feedback Form PHP Script Ver 2.02.
  4.   Generated by thesitewizard.com's Feedback Form Wizard.
  5.   Copyright 2000-2004 by Christopher Heng. All rights reserved.
  6.   thesitewizard and thefreecountry are trademarks of Christopher Heng.
  7.   $Id: phpscript.txt 3.3 2004/06/18 11:33:40 chris Exp $
  8.   Get the latest version, free, from:
  9.     http://www.thesitewizard.com/wizards/feedbackform.shtml
  10.   You can contact me at:
  11.     http://www.thesitewizard.com/feedback.php
  12.   LICENCE TERMS
  13.   
  14.   1. You may use this script on your website, with or
  15.   without modifications, free of charge.
  16.   
  17.   2. You may NOT distribute or republish this script,
  18.   whether modified or not. The script is meant for your
  19.   personal use on your website, and can only be
  20.   distributed by the author, Christopher Heng.
  21.   
  22.   3. THE SCRIPT AND ITS DOCUMENTATION ARE PROVIDED
  23.   "AS IS", WITHOUT WARRANTY OF ANY KIND, NOT EVEN THE
  24.   IMPLIED WARRANTY OF MECHANTABILITY OR FITNESS FOR A
  25.   PARTICULAR PURPOSE. YOU AGREE TO BEAR ALL RISKS AND
  26.   LIABILITIES ARISING FROM THE USE OF THE SCRIPT,
  27.   ITS DOCUMENTATION AND THE INFORMATION PROVIDED BY THE
  28.   SCRIPTS AND THE DOCUMENTATION.
  29.   If you cannot agree to any of the above conditions, you
  30.   may not use the script.
  31.   
  32.   Although it is NOT required, I would be most grateful
  33.   if you could also link to thesitewizard.com at:
  34.     http://www.thesitewizard.com/
  35. */
  36. // ------------- CONFIGURABLE SECTION ------------------------
  37. // $mailto - set to the email address you want the form
  38. // sent to, eg
  39. //$mailto        = "youremailaddress@example.com" ;
  40. $mailto = 'rkhetia@hotmail.com' ;
  41. // $subject - set to the Subject line of the email, eg
  42. //$subject    = "Feedback Form" ;
  43. $subject = "Feedback Form" ;
  44. // the pages to be displayed, eg
  45. //$formurl        = "http://www.example.com/feedback.html" ;
  46. //$errorurl        = "http://www.example.com/error.html" ;
  47. //$thankyouurl    = "http://www.example.com/thankyou.html" ;
  48. $formurl = "http://bynet.freeprohost.com/feedback/feedback.html" ;
  49. $errorurl = "http://bynet.freeprohost.com/feedback/error.html" ;
  50. $thankyouurl = "http://bynet.freeprohost.com/feedback/thankyou.html" ;
  51. // -------------------- END OF CONFIGURABLE SECTION ---------------
  52. $name = $_POST['name'] ;
  53. $email = $_POST['email'] ;
  54. $comments = $_POST['comments'] ;
  55. $http_referrer = getenv( "HTTP_REFERER" );
  56. if (!isset($_POST['email'])) {
  57.     header( "Location: $formurl" );
  58.     exit ;
  59. }
  60. if (empty($name) || empty($email) || empty($comments)) {
  61.   header( "Location: $errorurl" );
  62.   exit ;
  63. }
  64. if (get_magic_quotes_gpc()) {
  65.     $comments = stripslashes( $comments );
  66. }
  67. $messageproper =
  68.     "This message was sent from:\n" .
  69.     "$http_referrer\n" .
  70.     "------------------------- COMMENTS -------------------------\n\n" .
  71.     $comments .
  72.     "\n\n------------------------------------------------------------\n" ;
  73. mail($mailto, $subject, $messageproper, "From: \"$name\" <$email>\nReply-To: \"$name\" <$email>\nX-Mailer: chfeedback.php 2.02" );
  74. header( "Location: $thankyouurl" );
  75. exit ;
  76. ?>


Here's the associated feedback.html code (i'm guessing the error page and thankyou page could not be the cause of anything, so i'm not posting them):

Code: [ Select ]
<body bgcolor="ffffff">
<form action="feedback.php" method="post">
 <p align="center"><img src="images/feedback.gif" width="301" height="45"></p>
 <table border="0" cellpadding="8" cellspacing="8" summary="feedback form">
  <tr>
   <td>Name:</td>
   <td><input type="text" name="name" size="25" /></td>
  </tr>
  <tr>
   <td>E-mail address:</td>
   <td><input type="text" name="email" size="25" /></td>
  </tr>
  <tr>
   <td colspan="2"> Comments<br /> <textarea rows="15" cols="45" name="comments">
</textarea>
   </td>
  </tr>
  <tr>
   <td align="center" colspan="2"> <input name="submit" type="submit" value="Send Feedback" />
   </td>
  </tr>
 </table>
</form>
  1. <body bgcolor="ffffff">
  2. <form action="feedback.php" method="post">
  3.  <p align="center"><img src="images/feedback.gif" width="301" height="45"></p>
  4.  <table border="0" cellpadding="8" cellspacing="8" summary="feedback form">
  5.   <tr>
  6.    <td>Name:</td>
  7.    <td><input type="text" name="name" size="25" /></td>
  8.   </tr>
  9.   <tr>
  10.    <td>E-mail address:</td>
  11.    <td><input type="text" name="email" size="25" /></td>
  12.   </tr>
  13.   <tr>
  14.    <td colspan="2"> Comments<br /> <textarea rows="15" cols="45" name="comments">
  15. </textarea>
  16.    </td>
  17.   </tr>
  18.   <tr>
  19.    <td align="center" colspan="2"> <input name="submit" type="submit" value="Send Feedback" />
  20.    </td>
  21.   </tr>
  22.  </table>
  23. </form>


Any help would be greatly appreciated. Or if anyone has a better script they can tell me about, i'd be greatly appreciative. Also, my host does not allow ASP pages unfortunately.

Thanks, Sigma
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Cafu
  • Student
  • Student
  • Cafu
  • Posts: 97

Post 3+ Months Ago

From http://us3.php.net/mail:

Quote:
For the Mail functions to be available, PHP must have access to the sendmail binary on your system during compile time. If you use another mail program, such as qmail or postfix, be sure to use the appropriate sendmail wrappers that come with them. PHP will first look for sendmail in your PATH, and then in the following: /usr/bin:/usr/sbin:/usr/etc:/etc:/usr/ucblib:/usr/lib. It's highly recommended to have sendmail available from your PATH. Also, the user that compiled PHP must have permission to access the sendmail binary.


So, you may want to call tech support at your host to make sure they allow mail.

or, just make a test PHP file with one line:

Code: [ Select ]
mail ( "rkhetia@hotmail.com" , "Test subject", "this is a test message");
  • Mr Smith
  • Graduate
  • Graduate
  • Mr Smith
  • Posts: 150
  • Loc: Birmingham, England

Post 3+ Months Ago

SigmaSquared wrote:
Also, my host does not allow ASP pages unfortunately.


:P i'd say thatt's fortunate! :P
  • SigmaSquared
  • Novice
  • Novice
  • SigmaSquared
  • Posts: 23

Post 3+ Months Ago

^^

I suppose you maybe right. :) I e-mailed my host and they responded by letting me know that i need to get a domain with them in order to have the e-mail fuction activated. So i suppose that answers my question. The free service doesn't allow sending e-mails from within my site. :(

Anyway, thanks for the help!

Post Information

  • Total Posts in this topic: 4 posts
  • Users browsing this forum: No registered users and 57 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.