Improving The Reliability Of Emails Sent Through Caldera Forms

Catdera Caldera Forms Banner

One of the many benefits of Caldera Forms is its integrated email functionality. Using Caldera Forms, you can deeply customize the emails that go out to the people who submit the form, the people who must get the form submission, or both. However, the ability of Caldera Forms to send emails is dependent on WordPress’ mailer functionality (wp_mail), which is not terribly reliable across all server configurations.

We do not recommend relying on WordPress alone for ensuring emails from the form mailer, or the autoresponder processors are able to send emails. This article covers what to do instead.

When emails don’t send it is one of several things is to blame. I have listed these below, with troubleshooting steps, as well as alternative solutions that we use and recommend. It also details how to use mailer debug mode.

Too Much To Deal With?

Shouldn’t this kind of thing just work? We asked that question, too. It shouldn’t be like this, but it is. That’s why we built Caldera Forms Pro. One of its main features is enhanced email delivery. Sign up for Caldera Forms Pro today — with a free 7 day trial — and see how easy reliable, spam-free emails can be.

Caldera Forms Pro

Possible Reasons Why Emails Are Not Sending

First, let’s explore the common causes of poor email reliability:

  1. Your server can’t send any emails. Are password reset emails working?
  2. Your form never finishes submitting do to an error. Have you tried submitting with the JavaScript console open and with PHP error logging though WordPress active
  3. Are you using an SMTP plugin? Have you tried turning it off?
  4. The address you are sending to is not set properly. Have you double checked your settings? Also, did you try the mailer debug mode (you can turn this on at the bottom of the mailer tab) and see what email address it says emails are sent to?
  5. Is the phpmailer causing issues? If you enter debug mode, it may report errors.

Most of the time, if your emails from Caldera Forms are not being sent, this is a symptom of a larger problem on your site. The solutions that we recommend below should allow you to avoid the root problem for your whole site.

The other common situation that can lead to unsent emails, is invalid email addresses being provided. This can happen when using magic tags to provide the email address if they are not configured properly. The mailer debug function, discussed below, is useful for ensuring that you are actually sending a valid email address to the mailer.

Solution: Set Up An Email Alternative

Email alternatives ensure that emails sent from your WordPress site, not just from Caldera Forms, are actually sent, then we strongly recommend a third-party transactional email service such as Mandrill API  or SendGrid from MailChimp or an external SMTP server.

Mandrill is a paid add-on for MailChimp. SendGrid has a free tier (scroll to the bottom of their pricing page) that supports up to 12000 emails a month.

The Mandrill API allows you to use the infrastructure built for MailChimp.  If their infrastructure can handle the billions of emails that MailChimp sends every month, it can handle your site. The wpMandrill plugin is free and easy to set up.

The plugin is only listed as being tested up to WordPress 3.8, but it works perfectly fine on this site, and many others we have used it on.

Debugging Emails In Caldera Forms

Enabling Caldera Forms Mailer Debugging
Enable email debugging if you are having issues with emails being sent

In the Caldera Forms mailer tab, there is an option for enabling mailer debug. This enables logging of email details. It should not be left on, as it causes duplicate emails. When it is enabled, it adds php mailer logging to the entry viewer for the form.

This is information that will be useful to a server admin. You can provide this information to your webhost’s support service if you are having problems sending emails.

The debug mailer is also a reliable way to find out what email addresses, if any, are being used to send to and for the reply-to.

Caldera Forms Mailer Debug Entry

If That Doesn’t Work

If none of the above advice works, then this most likely means that no valid email is being passed to the recipients field in the mailer. Why this is happening is hard to say without testing. It could be happening for one of several reasons:

  1. Your mailer is not properly configured
  2. A conditional field is not filled in
  3. A processor is returning an error
  4. There is JavaScript error in the front-end that is preventing the form from being properly processed
  5. There is a server-side PHP error that is preventing Caldera Forms from getting to that point in execution

While checking your JavaScript console for errors, enabling WP_DEBUG, switching to the default theme, and other typical WordPress troubleshooting steps are encouraged, and may fix the problem they will not tell you what has gone wrong.

At this stage, to gather more detail, you should ensure that WP_DEBUG and WP_DEBUG_LOG are defined as true, and install this plugin. Then attempt to send a message again. This should create at least one, if not two entries in your WordPress debug log. If you are unfamiliar with debug logging, please see this article.

This plugin will log data about emails that Caldera Forms is attempting to send. If the mailer is executed it will log who it attempted to send to. If the email fails, a second, almost identical log entry will be made.

Here is how to interpret one of three possible results:

1) No entries are made. This either means that you have not enabled debug logging, or something is breaking form execution before the mailer. Presuming debug logging is properly configured, this means the problem is not likely related to the mailer.

2) You see one entry, marked “pre_send” in the debug log, per form submission. This means that mailer reported that it was working. It will also show you the recipients. If they are correct then you have a email configuration error on your server or external email service.

3) You see two entries, per form submission. This means the mailer reported a failure. Most likely this was because the recipients are not valid. You should see what was attempted to be used for the recipients.