A visitor submits your contact form and sees: “There has been a critical error on this website.” The form, the page and your fields are often fine. The problem is the email.
Why it happens
WordPress sends mail with PHP’s mail function by default. Many hosts disable or limit it. Depending on the setup, sending either fails quietly or, as on this site, throws a fatal error that breaks the form’s response.
How to confirm it
- Switch the form’s email action off and submit a test. If it now succeeds, email is the cause.
- If your form plugin can save submissions, turn that on so no messages are lost while you fix email.
The fix: SMTP
- Install an SMTP plugin such as FluentSMTP or WP Mail SMTP.
- Connect a real sending service: your Google Workspace or Microsoft 365 account, or a transactional service such as Brevo or Amazon SES.
- Send the plugin’s test email.
- Switch the form’s email action back on and submit a test message.
Good habits
- Send from an address on your own domain, and set the visitor’s email as reply-to.
- Add a honeypot field or Turnstile to keep spam out.
- Keep saving submissions as a backup even after email works.
