Testing email sending

To verify that you are able to send emails from your site, this guide will show you how to temporarily install a plugin to send a test email and debug the process. Please follow the steps below.

Step 1 – install the WP Mail SMTP plugin

Within the WordPress admin go to Plugins → Add New. In the Search box on the right enter WP Mail SMTP, and search, install the first plugin in the list (WP Mail SMTP). Activate this plugin once it has installed.

Note: while this plugin is active all WordPress emails will be sent using the settings you have entered for this plugin. So you can remove the plugin after this process to restore the default behaviour. Of course, if this plugin fixes any problems you were having receiving WordPress emails you can keep it active.

Step 2 – send a test email

Go to Settings → Email on the WP menu. At the Mailer option you can choose to send via SMTP or PHP mail(), if you have chosen SMTP then under SMTP Options enter the SMTP details into the fields, then click Save Changes. Now scroll to the bottom of the page and under Send a Test Email enter your email address. Click Send Test. At the top of the page there will now be a log of the test email sending process.

If the email failed to send, you will see this message at the top of the page:

The result was:

bool(false)

In the debugging output, find the line ["ErrorInfo"]=> and look at the text below to it to find the error message, check the table below for common error messages and possible solutions.

Error message Solution

Could not instantiate mail function.

This means that the PHP mail() function returned false i.e. the email was not accepted for delivery. This can happen for a number of reasons:

  • The server rejected the email because it doesn’t contain an address associated with the hosting account. It is common for hosts to have this restriction in place. See Solution #1 here.
  • PHP mail() is not configured on your server. Ask your host if PHP mail() is working, or if there is anything special you need to do to get it to work, or use an SMTP server.
  • You have exceeded the number of emails you are allowed to send per day. Ask your host about this, or use an SMTP server.
  • You are trying to deliver the email from a local server. If you are developing on a local server stack like WAMP, MAMP or XAMPP it doesn’t have a working mail server by default. In this case you should use an SMTP server.

SMTP Error: Could not connect to SMTP host.

This error occurs only when using an SMTP server, and means that a connection could not be made to the SMTP server. Double check that the Host, Port and Encryption you specified are correct. If you are using SSL or TLS encryption then you will need OpenSSL enabled in PHP (see the bottom of this page for more information).

SMTP Error: Could not authenticate.

This error occurs only when using an SMTP server, and means that authentication was not successful. Double check that the Username and Password you specified are correct.

Scroll down to the end of the log to see the detailed SMTP error debugging messages. The solution to the problem may be obvious in there, if not you can send the log in an email to info@themecatcher.net and we can take a look at it. You can continue to test different settings until you are able to successfully send a test email (don’t forget to Save Changes after changing any of the settings before sending another test email).

If the email was sent successfully you will see the message:

The result was:

bool(true)

Check your inbox to see if the email arrived. If it has then you can now copy the working SMTP settings to the Quform → Settings page.

If the email did not arrive, check the Junk/Spam folder or try a different recipient address. You might also want to wait a few minutes, as some hosts have slower delivery. If you can’t get it to work repeat Step 2 with different settings until it works.

Step 3 – uninstall the WP Mail SMTP plugin

If you have no further need for this plugin you can now uninstall it from the Plugins page.

See also

Still having trouble? Head over to the forums.

Forums