63 posts
  • 6 Years of Membership
  • Collector Level 2
  • 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
87 posts
  • 5 Years of Membership
  • Exclusive Author
  • United Kingdom
faevilangel_designs
says

what’s the code?

63 posts
  • 6 Years of Membership
  • Collector Level 2
  • 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
  • 6 Years of Membership
  • Affiliate Level 2
  • Author Level 4
  • Beta Tester
+4 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
  • 6 Years of Membership
  • Collector Level 2
  • 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
  • 6 Years of Membership
  • Affiliate Level 2
  • Author Level 4
  • Beta Tester
+4 more
vasilios
says

Yes. :)

63 posts
  • 6 Years of Membership
  • Collector Level 2
  • United Kingdom
dan888
says

Still bombs out? Help!

by
by
by
by
by
by