63 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 10+ items on Envato Market
  • Located in United Kingdom
dan888 says

Hi, calling all PHP people.

I’m getting http error 500 during email sending from a php script called from my form.

Email works fine.

It seems to be on the exit… or where I call the next page!

Any advice welcome

Cheers

Dan

faevilangel_designs
faevilangel_designs Recent Posts Threads Started
86 posts
  • Has been part of the Envato Community for over 5 years
  • Sells items exclusively on Envato Market
  • Located in United Kingdom
faevilangel_designs says

what’s the code?

63 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 10+ items on Envato Market
  • Located in United Kingdom
dan888 says

Hi,

Its sends the mail fine then bombs after the mail() with;

Server Error 500 – Internal server error There is a problem with the resource you are looking for and it cannot be displayed

Here is the part of the code…

$email_send = mail($email_to, $email_subject, $email_body, $email_headers);

if($email_send) {header(“Location: ”.$goto_after_email);} else {print “We encountered an error sending your email”;}

Thanks

Dan

426 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 10+ members
  • Has sold $5,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+3 more
vasilios says

Just to debug and check to see if the $goto_after_email page is broken (mod_rewrite/apache error?), change that statement to redirect to the index page (or back to the form). That’ll let you know that the page you redirect to after the email is successfully sent is the problem. :)

63 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 10+ items on Envato Market
  • Located in United Kingdom
dan888 says

Not sure I understand you. Do you mean change;

header(“Location: ”.$goto_after_email);

to

header(“Location: ”.”some url here”);

426 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 10+ members
  • Has sold $5,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+3 more
vasilios says

Yes. :)

63 posts
  • Has been part of the Envato Community for over 5 years
  • Has collected 10+ items on Envato Market
  • Located in United Kingdom
dan888 says

Still bombs out? Help!

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