Okay, I'm using a feedback.php file on my website index directory, and I'm fairly sure it's working properly since it sends me to the 'thankyou.html' page afterwards. However, no mail sent from the page will end up at email@yahoo.com for some reason! (I have alternatively changed the email target to a different one, 'email@gmail.com,' but it's not going through either.) Would someone check the code for errors?
(And before you ask, I'm using Ripway.com and they do support php)
This is feedback.php
(And before you ask, I'm using Ripway.com and they do support php)
This is feedback.php
Code:
$mailto = 'email@yahoo.com' ;
// $subject - set to the Subject line of the email, eg
//$subject = "Feedback Form" ;
$subject = "Realm of Gravity - Comment" ;
// the pages to be displayed, eg
//$formurl = "[URL unfurl="true"]http://www.example.com/feedback.html"[/URL] ;
//$errorurl = "[URL unfurl="true"]http://www.example.com/error.html"[/URL] ;
//$thankyouurl = "[URL unfurl="true"]http://www.example.com/thankyou.html"[/URL] ;
$formurl = "[URL unfurl="true"]http://h1.ripway.com/GravityX/index.html"[/URL] ;
$errorurl = "[URL unfurl="true"]http://h1.ripway.com/GravityX/woops.html"[/URL] ;
$thankyouurl = "[URL unfurl="true"]http://h1.ripway.com/GravityX/thanks.html"[/URL] ;
$uself = 0;
// -------------------- END OF CONFIGURABLE SECTION ---------------
$headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ;
$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 ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) {
header( "Location: $errorurl" );
exit ;
}
if (get_magic_quotes_gpc()) {
$comments = stripslashes( $comments );
}
$messageproper =
"This message was sent from:\n" .
"$http_referrer\n" .
"------------------------------------------------------------\n" .
"Name of sender: $name\n" .
"Email of sender: $email\n" .
"------------------------- COMMENTS -------------------------\n\n" .
$comments .
"\n\n------------------------------------------------------------\n" ;
mail($mailto, $subject, $messageproper,
"From: \"$name\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.07" );
header( "Location: $thankyouurl" );
exit ;
?>