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


- Joined: Jul 24, 2004
- Posts: 23
- Status: Offline
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:
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):
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
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 ;
?>
/*
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 ;
?>
- <?
- /*
- 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 ;
- ?>
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>
<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>
- <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>
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


- Joined: 25 Feb 2008
- Posts: ?
- Loc: Ozzuland
- Status: Online
July 29th, 2004, 8:25 am
- Cafu
- Student


- Joined: Jul 15, 2004
- Posts: 97
- Status: Offline
From http://us3.php.net/mail:
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:
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


- Joined: Jul 29, 2004
- Posts: 150
- Loc: Birmingham, England
- Status: Offline
- SigmaSquared
- Novice


- Joined: Jul 24, 2004
- Posts: 23
- Status: Offline
^^
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!
I suppose you maybe right.
Anyway, thanks for the help!
Page 1 of 1
To Reply to this topic you need to LOGIN or REGISTER. It is free.
Post Information
- Total Posts in this topic: 4 posts
- Users browsing this forum: No registered users and 302 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
