43 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 50+ items on Envato Market
  • Located in United States
sunschild57 says

I bought a template that was advertised to have a working contact form. The instructions said that all I had to do was change the e-mail address. I did this and the form doesn’t work. I e-mailed the seller but got no response.

This is the error message I get when I test the form: The server encountered an unexpected condition which prevented it from fulfilling the request. The script had an error or it did not produce any output. If there was an error, you should be able to see it in the error log.

This is the contact form Php:

<?PHP $to = “mediacovenant@gmail.com”; $subject = “Results from your Request Info form”; $headers = “From: Form Mailer”; $forward = 0; $location = ””;

$date = date (“l, F jS, Y”); $time = date (“h:i A”);

$msg = “Below is the result of your feedback form. It was submitted on $date at $time.\n\n”;

if ($_SERVER[‘REQUEST_METHOD’] == “POST”) { foreach ($_POST as $key ?> $value) { $msg .= ucfirst ($key) .” : ”. $value . ”\n”; } } else { foreach ($_GET as $key => $value) { $msg .= ucfirst ($key) .” : ”. $value . ”\n”; } }

mail($to, $subject, $msg, $headers); if ($forward == 1) { header (“Location:$location”);

} else { echo “ ”; }

?>

Can anyone tell me why this is not working! Thanks!

2541 posts
  • Has referred 10+ members
  • Has sold $100+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Located in United States
+9 more
CreatingDrew says
Please wrap your code in code tags or better yet a link to pastie.org. In addition add this to the top of your page for debugging purposes:

<?php ini_set("display_errors", "1");
error_reporting(E_ALL); 
?>

2023 posts Review Manager
  • Has referred 10+ members
  • Has sold $5,000+ on Envato Market
  • Has collected 100+ items on Envato Market
  • Member of the Envato Team
+12 more
jremick Envato team says

I don’t know if this is the answer to your specific problem but the contact form I’ve used in my templates uses PHP 5 . I’ve had several people contact me having problems with the contact form and the problem was their web server was using PHP 4 .

For the people using my contact form, they just had to download the PHP 4 version of of the PHPMailer class.

Anyway, post the code using pastie like Drew said and we should be able to help you out.

26 posts
  • Has been part of the Envato Community for over 5 years
  • Has sold $100+ on Envato Market
  • Has collected 1+ items on Envato Market
  • Sells items exclusively on Envato Market
+1 more
ominiom says

Are you sure you’ve set up sendmail on your server?

43 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 50+ items on Envato Market
  • Located in United States
sunschild57 says

...trying to understand pastie

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by