Contact form problems

I’ve used web hosts in the US, UK, Holland and Germany, but never France and I don’t have any good suggestions. Perhaps some other forum member can suggest something.

I don’t know how much web design you are doing for clients, but if you plan to do this regularly and have a number of clients it would make good sense to open a reseller account with a good web host and put all your clients on the same server. You should charge for this service.

mine is:

<?php if(empty($_POST['name']) && strlen($_POST['name']) == 0 || empty($_POST['name']) && strlen($_POST['name']) == 0 || empty($_POST['message']) && strlen($_POST['message']) == 0) { return false; } $name = $_POST['name']; $name = $_POST['name']; $message = $_POST['message']; $to = 'info@ennoia-med.fr'; // Email submissions are sent to this email // Create email $email_subject = "Formulaire de contact ennoia-med"; $email_body = "Nouveau message \n\n". "Name: $name \nName: $name \nMessage: $message \n"; $headers = "MIME-Version: 1.0\r\nContent-type: text/plain; charset=UTF-8\r\n"; $headers .= "From: benjamin.billottet@ennoia-med.fr\n"; $headers .= "Reply-To: DoNotReply@yoursite.com"; mail($to,$email_subject,$email_body,$headers); // Post message return true; ?>

i can see that there is a difference
name = _POST[‘name’];
email = _POST[‘email’];
message = _POST[‘message’];

name = _POST[‘name’];
name = _POST[‘name’];
message = _POST[‘message’];

would that be a problem & why do I have it different?

I just created a new for with the latest blocs, and it comes out the same as in my previous post. I would try renaming that second 'name entry to match the email one in mine, worst case it will not work.

As to why you have the difference I cannot say, as my retest worked fine.

Also noticed your ‘Reply-To’ isn’t using a valid domain which might also be a contributing factor.

I’m in train to rebuilt it from the begginig, let’s see it it works!
thanks a lot @MartinC

This is the code reworked, with the exception of the reply to field:

<?php if(empty($_POST['name']) && strlen($_POST['name']) == 0 || empty($_POST['name']) && strlen($_POST['name']) == 0 || empty($_POST['message']) && strlen($_POST['message']) == 0) { return false; } $name = $_POST['name']; $email = $_POST['email']; $message = $_POST['message']; $to = 'info@ennoia-med.fr'; // Email submissions are sent to this email // Create email $email_subject = "Formulaire de contact ennoia-med"; $email_body = "Nouveau message \n\n". "Name: $name \nName: $name \nMessage: $message \n"; $headers = "MIME-Version: 1.0\r\nContent-type: text/plain; charset=UTF-8\r\n"; $headers .= "From: benjamin.billottet@ennoia-med.fr\n"; $headers .= "Reply-To: DoNotReply@yoursite.com"; mail($to,$email_subject,$email_body,$headers); // Post message return true; ?>

Note sure why those ‘&&’ have appeared instead of line breaks

thanks a lot everybody, especially @MartinC!
the code was really messed up, no idea why!

I’ve done it the easiest way, I just built once again the contact form, for some reasons mine was writing the PHP code in wrong way!

As soon as I get some time I’ll try to figure out what went wrong!
In the meantime the contact form is working - so that’s essential!

1 Like

Glad to help, let’s hope this was an odd quirk and it never happens again for you :grinning:.

the mail delivery is not reliable I have the form working. I submit form 50 time in 2 days and receive on 43 emails so that is 14% fail rate. when you have a business site expecting to get enquiries this is terrible.

client see a success message and waiting for response and I receive nothing which means loose of profit.

not happy with the blocsapp more I use I feel like it is not for a serious business. :frowning:

It would be highly unlikely that the Blocs email script is at fault here. That is more likely either a host issue or mail server issue.

You of course are not restricted to the Blocs form script, you can add your own. And try that test again, that would be interesting.

Hi @PeteSharp

I agree it might also have to do with hosting provider but usually when I use some custom script or another bootstrap template site from theme forest when I see success message it is 99.99% confirmed that I will receive the email

however with sites created with blocs-app doesn’t always deliver even when it show a success message and fail rate is high

maybe I will use custom contact form providers to use on the blocs app, or you suggest a different solution?

the only problem using custom script or modify the blocsapp website is when ever I make changes to blocsapp site and export I have to redo the same work evrytime.

? You can do it all in Blocs. Set the form to custom.

can you make a custom form which can guarantee 100% delivery?

I will be really interested in this let discuss the possibility of a private contact form brick in private.

No one can guarantee that, because there are so many things out side of the control of the script. eg. Host, Mail Server etc…

This doesn’t add up. I have many clients with websites built using Blocs on various servers and I know messages are going through reliably.

I always do them the same way and never have a problem. Actually I do them the same way I did using Foundation with Rapidweaver and Blocs is certainly no worse for reliability. They just work.

Obviously if your mx settings were messed up or you were using a web host with a congested mail server etc all bets are off. I remember many years ago hosting with Dreamhost and the mail server went down almost daily.

This is more likely to do with the host being a little nervous about spam emails. You say you sent the form 50 times in 2 days and received 43 email responses, but you don’t stipulate the frequency at which those emails were sent on each day. This should indicate that here is a limit at which the mail server will start thinking that a spam bot is in control of your mail processing script. If the frequency is exceeding the limit set by the server, it will stop processing for a certain period of time and then resume delivering after that time period. I suggest you ask your host to clarify what it’s PHP mail limits are (i.e. number of emails per hour or whatever parameter it may be). If the standed rate is set too low for you, ask them to set it at a higher limit Remember, we are not talking about the standard email send rate (which on some hosts can be about 50 emails per hour), we’re talking here about the PHP sendmail function which doesn’t use SMTP.

1 Like

Good news delivery rate improves I have 4 messages sent 3 days ago arrived in my inbox today and other 1 sent day before yesterday. on average messages take 30 minutes to arrive in my gmail inbox.

so it is totally up-to the server I think for delivery.

but still I expect from blocs app developer to add some sort of tutorials or documentation on how can one enhance the delivery rate of contact form created with blocs app

at the moment blocs app comes as IKEA furniture without assembly instructions. you have everything nuts & bolts but you have to figure out the puzzle. :grimacing:

Ever looked at the user documentation? There you’ll find informations and instructions for most of Blocs features. Lot of quite useful stuff there. I agree that it doesn’t cover everything, but hey … we still got Eldar and his tutorials. Worth checking out if you still haven’t.

Concerning forms: Forms – Blocs – User Documents

I doubt though, that @Norm can do anything about Email delivery performance, since that’s up to your Email provider, not Blocs. Correct me if I’m wrong :wink:

I’d suggest changing your web host. This sounds very much like they are over selling and everything is backed up.