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.
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??
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.
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