Submit Forms and PHP

What version of PHP does bloc support for submitting form with contact information?
On PHP 8.0 I get the success message but don’t get the email. On PHP 8.1 I get the failed message and of course don’t get the email.

I think this is a server side issue as I have other contact forms that work. I have contacted my web server host two times but they did not provide any workable answer.

Blocs manual for forms

Any ideas?

Are you using an older version of Blocs 4? There was an issue with PHP 8 or above that was fixed with an update.

No I am using Blocs 5

Can you switch the version of php you are using to say PHP 7.4. What happens then?

Yes, I switched to 7.4 with this I get the failed message. I also get the failed message with 8.1 and 8.2. PHP 8.0 is the only version I get the success message.

I am talking with IONOS right now for the third time… no luck with then??

Did it ever work OK before?

Maybe the error logs in your hosting might shed some light on this (use the form then look at the logs time stamps you use the form)

Maybe do a clean upload of the full site incase some old php form files are still lingering there,

I know Blocs 5 works reliably for me with with various PHP versions, so I suspect the issue here is with the web host.

I also use IONOS with php 8.1 and all working fine.
I also used 7.4 and all was good then.

In that case I would suggest @eagle clears the contents on the server and upload the website from scratch. One way or another though Ionos should be able to test this. I only had one experience with them about 5 years ago on behalf of a client and we ended up moving the site to my server.

Here where this issue stands now.

Using Blocs 5.0.7. PHP 8.0
I have cleared the contents on the server, uploaded the website. Did not fix the problem
Created a new test website loaded it into a test subdomain of the website Test Highlandfence Company
This test site has two pages. Home page and contact page. On the home page it has one bloc with a code bric.
The code bric has the following code I got from IONOS

<?php

// THE BELOW LINE STATES THAT IF THE SUBMIT BUTTON
// WAS PUSHED, EXECUTE THE PHP CODE BELOW TO SEND THE
// MAIL. IF THE BUTTON WAS NOT PRESSED, SKIP TO THE CODE
// BELOW THE "else" STATEMENT (WHICH SHOWS THE FORM INSTEAD).
if ( isset ( $_POST [ 'buttonPressed' ] )){

// REPLACE THE LINE BELOW WITH YOUR E-MAIL ADDRESS.
$to = 'info@highlandfenceco.com' ;
$subject = 'From PHP contact page' ;

// NOT SUGGESTED TO CHANGE THESE VALUES
$message = $_POST [ "message" ] ;
$headers = 'From: ' . $_POST[ "from" ] . PHP_EOL ;
mail ( $to, $subject, $message, $headers ) ;

// THE TEXT IN QUOTES BELOW IS WHAT WILL BE
// DISPLAYED TO USERS AFTER SUBMITTING THE FORM.
echo "Your e-mail has been sent! You should receive a reply within 24 hours!" ;}

else{
?>
<form method= "post" action= "<?php echo $_SERVER [ 'PHP_SELF' ] ;?>" />
  <table>
    <tr>
      <td>Your e-mail address: </td>
      <td><input name= "from" type= "text"/></td>
    </tr>
    <tr>
      <td>Your message: </td>
      <td><textarea name= "message" cols= "20" rows= "6"></textarea></td>
    </tr>
    <tr>
      <td></td>
      <td><input name= "buttonPressed" type= "submit" value= "Send E-mail!" /></td>
    </tr>
 </table>
</form> 
<?php } ?>

Using this code I get the email.
The contact page has just a form bric and when I submit the form I get the success message but do not get the email.
Also uploaded the same blocs project to the following URL Test Forms with the same result from the contact page. No email

Here is my test blocs project

MailTest.bloc.zip (15.1 KB)

Any ideas how to debug this further? Can I turn on a php debug log?