How email notifications are sent
Like most other WordPress plugins, Gravity Forms does not handle emails directly. Gravity Forms uses the wp_mail() function that is provided by WordPress to send any emails.
Once Gravity Forms hands the email off to the WordPress wp_mail() function, one of the following occurs:
- WordPress directly interacts with your web server to send the email.
- WordPress contacts your SMTP or external 3rd party mail server to deliver the email.
After WordPress hands the email off, it’s up to the mail server, as well as the recipient’s mail server, to complete the sending of the email. We don’t have any control over the delivery process once the email is passed to WordPress.
If you’re having trouble sending sending or receiving emails from Gravity Forms, this article will provide you with a few different steps to follow. In the overwhelming majority of cases, these steps have been proven to resolve a multitude of email issues.
Ensure WordPress and Gravity Forms are up to date
The first thing you want to check is your WordPress and Gravity Forms versions. The version you are on could potentially have a bug in it that is fixed within a newer version. Checking that you are running the latest version is a critical step in troubleshooting any issues.
Check your settings
When configuring notifications, it’s easy to miss an error in the recipient address or elsewhere. By looking over the notification configuration carefully, a quick mistake can be easily resolved.
Check for typos
It’s easy for a small typo to turn into a big problem. Check for any typos within your notification feeds.
Within your notification, check for any spaces in the recipient’s address, or between multiple addresses. If a space exists in the setting, it can potentially cause the notification to fail.
Check the sender
Far too often, we see situations where an email address is configured as both the From Address and To Address. For many mail providers, this will cause the email to be rejected as spam (or placed in a spam folder). Be sure that you use a different, valid email address in the From setting.
Within the sender, or From field, ensure that it is the address that the message is originating from, that must be an email address authorized by your server (e.g. an email using the same domain that your site uses). If not, things like SPF records and/or DMARC records can cause the mail to be marked as spam and rejected. If you need to allow the recipient to reply another address, set it as the Reply To address instead.
Some providers as Yahoo or AOL are known to apply this policy. For more information on the Yahoo domain issue visit the following:
Yahoo email anti-spoofing policy breaks mailing lists.
For more info on the AOL domain issue visit the following:
AOL imposes stricter email rules.
Check routing conditions
If you have routing configured for the notification recipient, be sure to double-check that at least one condition was successfully met. If none of the conditions were met, a notification would not be sent, as it would not have a valid recipient.
Is the notification enabled?
While doing form tests it’s common to disable notifications to prevent receiving lot of emails that we don’t really need. Sometimes you can forget to enable the notification again ( it happen more that you think 😉 ).
To check if your notifications are enabled, access the form editor, then click on *Notifications at the top menu. You should see a list of all configured notifications for that form. Be sure that all notifications are enabled and the toggle switch to the left of the notification name is green.
Sometimes, due to server settings or e-mail reliability issues, using PHP sendmail does not work. Switching to SMTP can be more reliable and solve many issues.
There are a number of SMTP plugins for WordPress. You will need to install one of the following and set it up using the details given to you by your web host or third party SMTP host.
Install the logging add-on
By using the logging add-on, you can easily identify when errors occur, and why they are occurring. Reviewing your logs will allow you to see where the notification might be failing, and correct the issue if it’s within the scope of Gravity Forms side of things. If the issue happens after passing the email to the wp_mail() function then only your server admin can help you to continue the troubleshooting.
Check below most common results reported by wp_mail() function.
Result from wp_mail(): 1
This means that your Gravity Forms notification settings are fine, the email was passed to wp_mail() function without issues and WordPress reported successfully handing off the notification for delivery. Now the ball is in the server side. Only your server admin can investigate this further.
PHPMailer class returned an error message: Could not instantiate mail function.
WordPress is not able to send the email because for some reason the PHPMailer class included in WordPress (used by the wp_mail() function) can’t use the PHP mail function. Most of the time this is caused by some restriction in your hosting (e.g. a spam filter was triggered in your server and the email was rejected).
SMTP Error: connect() failed
You’re using a SMTP plugin to send the emails but WordPress can’t connect to the SMTP server. Most common causes for this are incorrect settings in your SMTP plugin, your hosting is blocking the outgoing connection to the SMTP server or the SMTP server is blocking connections coming from your web server.
SMTP Error: Could not authenticate
This WordPress is able to reach the SMTP server, but it can’t authenticate. This can be caused again by incorrect details used in your SMTP plugin (double check not only the username and password but also the port and encryption used). You might also see this error when the SMTP user that you’re trying to use is not active (e.g. disabled by an admin).
SMTP Error: Data not accepted
This means that the SMTP server is rejecting your email message because it contains something not allowed by the SMTP server rules. Most of the time it can be due to from address restrictions (many SMTP servers only allow to use the email address associated to the username that you’re using to send the email), but it can be any other part of your email content.
Check for plugin or theme conflicts
Sometimes other plugins or themes create issues that stop notifications from working. Please go through the following instructions to test for a Plugin or Theme conflict.
Contact your web host
If there wasn’t a plugin or theme conflict, SMTP isn’t working for you or you’re seeing in your log any of the results described in the logging add-on section, then you will want to contact your web host and have them look at the server logs to check to see if there are any errors being written.
Often they will see if things are being blocked, by them on purpose or due to some server misconfiguration issues.
Understanding E-mail Reliability
There are a huge number of potential issues that can lead to your notifications not being sent or received, and as such, if you’ve gotten to this point, you are most likely experiencing an issue that is less common and will require the support of your server administrator to solve.
Joost de Valk has written a great summary of why there can be so many issues in e-mail reliability that we hope you will find as a good guide to help you understand the factors at play, and hopefully come to an acceptable solution for any issue you may be experiencing.