Internal Server Error 500, PHP mail()

Wednesday 25 Jul 2007 19:39

500 - Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.


I came across this error today and it was not immediately obvious where it lies. In fact if you're using the mail() command, chances are that its been caused by you passing an empty 'to' parameter. For example, the following code with this deliberate mistake would cause the error message to be displayed.

Another reason can be problems with a .htaccess file somewhere in the path to your script.

Related articles

Comments(2)

captcha
9 Aug 2010 11:50 by Damage
Thanks for pointing this out! I was building a tell a friend script for a site and I kept getting this error, it was like you said because there were no parameters being passed from the form to the script - by default dreamweaver adds a 2 on the end of your text box names if you have more than one form on the page!
30 Jun 2010 09:14 by Anibute
I too had the problem. Empty 'to' parameter was the culprit.