Mail problems

I have a problem with the mail form in Blocs.
For a client I have made a simple contact-form in a modal on her website. But on a miraculous way most of the time the mail does not arrive. It states the mail has been send, but most mails do not arrive. I use the self hosted option in the form. To be clear; sometimes the form works, most of the time it doesn’t.
The website is https://puravoetverzorging.nl

If it works sometimes but not others that suggests the setup with Blocs is correct, but more likely issues with the mail server or possibly being flagged as spam.

1 Like

Yes, that was what I was thinking too:

  • sometimes the form works, so the settings in Blocs are most likely correct
    I have made a new mailadress to test the the form myself; it doesn’t arrive in the spambox… it just simply vanishes…

Are you using an email address like my_email@puravoetverzorging.nl? If not any other mail address (like Gmail) will cause trouble. If the mail address is hosted on an Office365 Exchange account you might run into trouble as well. To get it working properly the email address should be the same as the domain address.

1 Like

For the form I use info@puravoetverzorging.nl as the “from mailadress”, I also use a mailadress@puravoetverzorging.nl as a “Send to”…

You could check various server points like the SPIF, DKIM, MX data, routing and the rest but that would bring us back full circle, because nothing would likely come through if there was a problem.

My first suggestion would be to contact your web host and ask them to make some checks.

2 Likes

Jerry mentioned using Office 365 in which case you would have set the routing to remote, updated the MX data and CNAME records etc inside the Zone editor.

Having just run an MX check it looks like you are using webreus.nl, which I am guessing is your web host. If this is a budget priced web host they are often over subscribed with far too many users and email can become a problem, however you would also see that with email in general if this was the case.

1 Like

Thanks for all your input!!! Fantastic.
I use Apple mail and with other website at the same host I don’t have any issues. I have already send them an email with my concerns, hopefully they can bring a solution…
For now I will close the contactform on the website and put a mail-link instead…

Or just use a forwarder like formspree. They’re offering a free plan. I’ve used them for a while for an email hosted on Exchange. Never had any issues with them.

1 Like

Well I got answer form the web host:
“You are using the standard PHP mail function.
The phpmail function is often seen as spam.
This is because more and more recipients see this method of sending as spam.
So this is a method that is outdated. Use smtp to send the email form, then the problem is solved.”

My question now is: How do I set SMTP in a Blocs form?

I don’t think you can set this in blocs. I guess you can do this at on your hoster’s website. Maybe you should ask them again.
Btw: I know POP and SMTP… never heard about PHP regarding mail function.

PHP is commonly used for forms on websites, whereas SMTP was more usually associated with sending email on your computer.

2 Likes

good to know, thanks @Flashman

Is there a way to set up the standard Blocs form using the SMTP protocol?

First, I would switch hosts if they insist that “php mail() function is outdated… seen as spam… etc”
Those are just excuses to avoid sending emails from their server, and force you to SMTP which generally means you will buy a service (SMTP host) and send the mail over that service.

I did not know this as well but sending mails apparently costs money.
So several hosts either throttle your mails (send them in bulk) or simply disable it.

To implement SMTP you would need a SMTP host.
You would still send the mails with PHP but thru the SMTP host.

Very simple example:

ini_set("SMTP", "aspmx.l.google.com");
ini_set("sendmail_from", "YOURMAIL@gmail.com");

$message = "The mail message was sent with the following mail setting:\r\nSMTP = aspmx.l.google.com\r\nsmtp_port = 25\r\nsendmail_from = YourMail@address.com";

$headers = "From: YOURMAIL@gmail.com";

mail("Sending@provider.com", "Testing", $message, $headers);
echo "Check your email now....<BR/>";

As you see we still use mail() but we send it to the SMTP which then delivers the mails.
You could also use PHPMailer(); PHP class instead of the method mail() but still - PHP is PHP and “disabling it” is not the way to go. WordPress as an example powers some 40+% of all websites out there and… it is built on PHP, and relies heavily on the PHP mail() method since all its User and else notifications are generally, and by core, sent thru wp_mail() function which is just a wrapper for the PHP Core method

One of the most common “issues” I have with my clients is “The e-mails are not arriving”. And in all cases it is the Host disabling it or throttling it. Of course, usually the first answer of the Host is “Your code is faulty” until I prove them with a small POC that the mails are indeed sent but never leave the server. And then the next reply often is “I will escalate this issue” where you then will hear “mail() is disabled on this partition, shall we enable it?”

LOL
That said, you should be able to use SMPT in Blocs if you use the custom/self hosted option, as I believe it allows you to set the method which sends the mail, and that method would then be your custom function that implements SMTP
Quick google shows there seem to be free SMTP services as well (found Free SMTP Server. Fast. Secure. Reliable | SendPulse as example) but I never used or worked with them. I usually insist that the hosts enable mail() because I don’t want to deal with SMTP (plain simple lazy developer :rofl:)

Hope this somehow helps!

2 Likes

@Mattheus I don’t quite understand the logic of the answer you received from your web host. If you were using a PHP form to send out email to others in big quantities they might have a point, but in this instance you are only receiving email through their own system to your associated email.

They would have a case if the form was hacked with a thousand emails an hour going out, but in your case I am guessing it’s just an occasional received email from your own website. I would echo the thoughts of @smileBeda and suggest changing host.

I have standard Blocs contact forms on numerous websites and they all just work without problems. Mail is sent and mail arrives. Very curiously perhaps I don’t receive spam through these forms either.

1 Like

@Flashman and @smileBeda
You both describe exactly how I feel about this. I have used the Blocs form on many websites, also hosted bij the same web host. And this is the first time I run into trouble, or in a worse case scenario; I know of trouble…

The obvious solution is to change to a more reliable web host. That is not entirely my decision to make. So I would like a to use the custom option in the form settings. I do have SMTP settings data from the same web host, so I can easily create an extra mailadres etc. But I have no clue on how to set this up in Blocs…

Let me see if I can set an example up for you

But please bare with me, it could take a day or two to find some hours free to try this out

Basically what I’ve written in my previous comment is how you’d have to proceed

Choose the Self hosted Option, create a php method to call and in that method route to the smtp

What I wonder thou is if they disable mail() function- how it would work with smtp as that still needs php mail() to work!

Can I ask - is your site on WP or a static HTML?
And what’s the host? I keep a list of „no go“ hosts so I can provide best suggestions to people… would be great (or not so great) to add one more to that list :wink:

1 Like

That would be absolutely great!!! I think many other users on this forum will highly appreciate that as well!

Well, I’m Dutch… well known for patience!

I saw the code, but I have no clue on where to put it and what to set in the custom settings…

I have no clue. All I know for now is: with the standard form, with standard mail settings, that mail most of the times does not arrive. Not in in the mail, not in the spam folder.

It is a very basic Blocs website, PHP and no WP.

It is hosted by Webreus in The Netherlands. Pretty cheap; now I know why… :disappointed_relieved: :disappointed_relieved:

Actually, since I work at a (premium price segment) webhosting company, I might be able to shed some light on this matter. Their answer is in fact correct.

While php mail has been a standard way of sending messages for years, it is also very much unauthenticated and not very secured at all. This means that there is less control over who is sending what via that server.

You would want to use the SMTP way of sending just to get that authenticated sending as an advantage. This improves the spam score of your message (which can make a significant difference when dealing with recipients on Hotmail or Outlook.com for example).

Besides that you would also want to setup DKIM, DMARC and SPF to improve the authenticity of your message, but DKIM and DMARC can only be implemented when using the SMTP way of sending, as this is tied directly to your SMTP-server.

So no, the solution would not be to switch hosts, since you will probably be getting the same answer at your new provider, but to adhere to best practices for sending messages. Https://mail-tester.com is a tremendous help for this in my humble opinion.

Based upon my experience, this could be related to SPF being enforced somewhere along the way. What “from”-address did you specify in the form?

4 Likes