Php file keeps returning as html text

Please note that only scripts with the .php extension are processed as PHP code. Files with the .html extension are assumed to be static HTML only and are sent to visitors as-is, including anything that would have been processed as valid PHP code.

The URL at http://boriso.infinityfreeapp.com/mail.php does not show the source code to me though, it just shows a blank page. When I check the Network tab in my browser I see the status code of the page is 500, which means the PHP code on the page has crashed.

Finally, please note that the PHP mail() function is heavily restricted on free hosting to the point where it cannot be used for almost everything. If you want to be able to send email, you best bet is to use a third party SMTP service.

We’ve created an example contact form template with PHPMailer, ReCaptcha and provided instructions on how to use it with Gmail’s SMTP server.

4 Likes