A visitor fills in the form, the website says “Sent” and nothing arrives in your inbox. A common cause is a single line of code: the form tries to send the email in the visitor's name. Mail servers reject that today.
What happens when the form is sent
A website form doesn't deliver anything by itself. It hands the message to a mail server, which sends it on. Every email has a sender address, the From header. Older forms put into it the address the visitor typed into the field. It looks practical, because you can then answer the enquiry just by clicking Reply.
But that way the website sends email on behalf of someone else's domain. To a mail server this is no different from a spoofed email of the kind attackers use for phishing.
Why Seznam rejects such an email
When a website sends through the SMTP server of Seznam (the largest Czech email provider), it logs in with the username and password of a specific mailbox. Seznam then only lets through messages whose sender is exactly that mailbox. An email with a different address in From is rejected right at sending. The website often doesn't show it, because the form displays no error and only writes it to a log, if at all.
Other providers behave in a similar way. And when the website sends without logging in, through the PHP mail() function, the receiving server decides. If the visitor's domain publishes a strict DMARC policy, the receiving server rejects the message or sends it to spam. The result is the same: the enquiry is lost.
The correct setup
- The sender (
From) is always your mailbox, the one the website uses to log in to SMTP, for exampleweb@yourcompany.cz. - The visitor's address belongs in the
Reply-Toheader. Replies then go straight to them, just as conveniently as before. - Send via SMTP with login, not via
mail(). A logged-in sender has a much better chance of delivery. - The sender's domain has valid SPF and DKIM, so the recipient can tell the server is allowed to send for it.
You can choose the sender name freely. So in From you can put, for example, “Website form” with your address, and you will see straight away in your inbox where the message came from.
On a company website we built, the form sends enquiries through Seznam's SMTP. The sender is always the mailbox we log in to the server with. The visitor's address is only in the Reply-To header, so replies go straight to the visitor.
How to check it
- Fill in the form yourself with a Gmail or Seznam address, not your company one. Send the message that should reach you as an outsider would.
- Wait and see if the message arrives. Check spam too.
- Open the message headers (in Gmail “Show original”).
Fromshould show your domain,Reply-Tothe address from the form. - Look at the authentication results. SPF and DKIM should show
pass. - Click Reply and check that the visitor's address was filled in as the recipient.
If the message doesn't arrive at all, look for the error in the website log or in the form settings. An SMTP server message about a rejected sender address means exactly the problem described above.
Checks in day-to-day operation
A form that once worked can stop. It's enough for someone to change the mailbox password or for the hosting provider to move the website to another server. The simplest safeguard is a blind copy of every message to a second address you read regularly. If nothing has come from the form for a long time, that is a signal to test it.
When to bring in an expert
The website's developer can fix the sender address in a few minutes. Help is useful when messages land in spam even with the correct sender, when you don't have SPF, DKIM and DMARC set up, or when the website sends several kinds of email, such as order confirmations from an e-shop. We'll go through the whole path of the message from the form to the inbox and set up the domain so that recipients trust it.