How to Configure WordPress to Send SMTP Mail

Wordpress Send Smtp Emails Featured

WordPress, for all its qualities that allow you to design a web presence with ease, still has difficulties in certain areas. One of the problematic issues is the use of SMTP to send emails. This is especially troublesome if you are selling items via the WooCommerce platform plugin or simply need to communicate with customers, members or users on a regular basis.

There are many third-party solutions available to help with this problem such as Mailgun or Google Apps, but these are paid apps, and not everyone has the resources to dedicate to such solutions.

The WordPress issue

WordPress uses PHP as a backbone to its system, and many hosting providers have this PHP installation misconfigured, or even disabled, with a view to the security of their customers. This is the crux of the issue. WordPress emails will not be delivered if the hosting provider has blocked them. Even so, WordPress is using the default PHP’s mail() function to send emails, which is often not properly configured and will land in the Spam folder most of the time.

Also read: WordPress.com vs WordPress.org: What’s the Difference and Which One Should You Use?

The solution

Instead of using PHP to send emails, SMTP is a far better alternative. SMTP stands for Simple Mail Transfer Protocol and is what facilitates the process once you have clicked Send.

In order to use your own domain with WordPress and SMTP, you will need to install the WP Mail SMTP plugin.

Once installed, navigate to “Settings -> WP Mail SMTP” in the menu on the left of your WordPress administration dashboard.

Enter the email address you want to use, usually “something@mydomain.com,” and add the name that you want to use for sending. This will be what people see when they receive your message.

wp-smtp

Next, you need to scroll to the bottom where the Mailer options are. Click “Other SMTP,” which will reveal the further settings seen below.

wp-smtp-details

  • Enter the SMTP host details, encryption type, and the port number. Typically, the host will be something like “mail.yourdomain.com;” however, it can be different. Mine shown above is “smtp.hosts.co.uk.”
  • The encryption will depend on your host’s setup. If your host has enabled this, then SSL is the bare minimum to use, and ideally TLS should be used.
  • As for ports, the selection is based off the encryption type. Port 465 is for SSL, and Port 587 is used for TLS, otherwise it is Port 25, if no encryption is used.

Finally, if it is required, use the slider button where it says “Authentication” to enable you to enter the Username and Password. If you are unsure of these details, then your web hosting provider can give you them, or they will perhaps be within your host’s Admin Control Panel.

Click the Save button at the end of the Settings once you are satisfied everything is correct.

Testing

You can test the settings by clicking the “Email Test” tab. Enter the email address which will receive the test email and click “Send Test.” If it is successful, you have correctly configured the plugin and are ready to send emails from WordPress.

wp-smtp-test

Additional Settings

This is optional but recommended. The password you enter into the plugin is kept in “plain text,” which means anyone can read it. You can see the text below the Password field as shown in the following image.

wp-smtp-password

You need to edit your wp-config.php file which is located in the root directory of your WordPress install. Remember to back up the file before making any changes.

Locate the line that says, “That’s all, stop editing! Happy blogging” and add the following code just before it.

define( 'WPMS_ON', true );
define( 'WPMS_SMTP_PASS', 'your_password' );

Change “your_password” to your actual password and save.

Troubleshooting

If you find that your emails still won’t send, then check the port numbers and the details entered. Most of the time it is a combination of the encryption used and the port number. Your hosting provider or email provider should be able to assist further.

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Matthew Muller Avatar

Read next

Suzanne Simard sealed paper birch and Douglas fir seedlings inside plastic bags, fed them carbon-14 and carbon-13 dioxide, and nine days later found carbon had crossed between species through fungal threads in the British Columbia soil beneath her boots
A species of jellyfish called Turritopsis dohrnii can revert its adult cells back to a juvenile polyp stage when injured or starving, effectively restarting its life cycle, and biologists have so far failed to identify any natural limit to how many times it can do this.
A Japanese man named Jiroemon Kimura, who lived to 116, was born in 1897 when Queen Victoria still ruled and died in 2013, meaning a single human life personally overlapped with the invention of the airplane, the atomic bomb, the internet, and Instagram
The Hollywood sign originally read HOLLYWOODLAND when it was built in 1923 as a real estate advertisement for a housing development, and it was only meant to stand for 18 months, but nobody ever got around to taking it down and the city eventually adopted it as a landmark
Almost all of the world’s internet traffic does not travel by satellite but through fibre-optic cables lying on the ocean floor, a hidden web of wires crossing the deepest parts of the sea to connect the continents.
People who flip their phone face down on every table aren’t being secretive. They figured out that staying interruptible meant handing their time to whoever rang first
Twitch vs. Facebook Gaming vs. YouTube Gaming: What’s the Best Live Game Streaming Platform?
Chrome Extensions Ownership Transfer is a Direct Threat to You: How to Stay Safe