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
83 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 5 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 5 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!

by
by
by
by
by
by