I get a \"Premature end of script headers: contactform.cgi\" error message when running the below script. What frustrates me is that I ran this as a .php on another server
I have this issue and resolve this by changing PHP version from 5.3.3 to 5.6.30.