VIG Digital
arrow_back All articles
WORDPRESS November 1, 2023 · 5 min read

How to Set Up SMTP to Send Email from WordPress

If you run a website, being able to reach your users by email from WordPress is essential. But if you rely on PHP’s default mail function, there is a high chance your emails will land in spam, or not be sent at all.

What is SMTP?

SMTP (Simple Mail Transfer Protocol) is a communication protocol for sending email over the internet. A WordPress blog can send email without an SMTP server. However, emails with large files or videos attached are hard to send, and sometimes are not allowed at all.

Because PHP’s mail function sends email without authentication, your hosting can end up blocked by international anti-spam organisations and placed on a blacklist, leaving it unable to send or receive email.

So, to send email safely from your website, you need to configure an SMTP mail server.

Problems when you don’t use SMTP:

  • You send an email from your WordPress site, but it never reaches the recipient
  • The email is sent, but it lands in the spam/junk folder
  • The email is not sent because of server restrictions
  • The email gets lost somewhere on the server

What Easy SMTP is and what it does

Easy WP SMTP lets you configure your site to send all outgoing email through an SMTP server. This keeps your emails out of the recipient’s junk folder, and best of all, it is free.

Easy SMTP features:

  • Sends email through an SMTP server
  • Connects your WordPress blog to a mail server that handles all outgoing email
  • Delivers email to your recipients securely
  • Optional logging, so you can check whether emails were sent successfully

Get a Gmail app password

You need to create a separate password that your website uses to log in to Gmail and send email to the admin or to customers. This separate password keeps your main Google account password private.

Step 1: Go to “Manage your Google Account”

Step 2: Go to Security → 2-Step Verification and turn it on if it isn’t already. Google only lets you create app passwords once 2-Step Verification is on.

Step 3: Open the App passwords page at myaccount.google.com/apppasswords, or type “App passwords” into the search box in your Google Account.

Step 4: Enter an app name, such as your website’s name, so it is easy to recognise later.

Step 5: Click Create to get a 16-character password.

After this step, copy the email address and the new password somewhere safe to use on your website.

Install and configure Easy SMTP

Install the plugin

Go to Plugins -> Add New, type Easy WP SMTP into the Search Plugins box, then install and activate it.

Configure Easy SMTP

First, open the plugin from Dashboard -> Settings -> Easy WP SMTP.

Configuration options:

  • From Email Address: the email address recipients will see
  • From Name: the name recipients will see when they receive your message
  • SMTP Host: the SMTP server you use
  • Type of Encryption: the type of encryption you use
  • SMTP Port: the port used to relay outgoing mail to your mail server
  • SMTP Authentication: SMTP authentication. This option must always be set to “Yes”
  • SMTP Username: your email account name
  • SMTP Password: the password you use to log in to your email

Gmail

  • SMTP server: smtp.gmail.com
  • Encryption: SSL
  • SMTP port: 465

Yahoo

  • SMTP server: smtp.mail.yahoo.com
  • Encryption: TLS
  • SMTP port: 587

Outlook / Hotmail

  • SMTP server: smtp-mail.outlook.com
  • Encryption: TLS (STARTTLS)
  • SMTP port: 587

Note: Microsoft no longer allows password-based SMTP sign-in for Outlook.com / Hotmail accounts and has moved to modern authentication (OAuth). If you use Outlook, Hotmail or Microsoft 365, choose a plugin that connects to Microsoft directly (for example the Outlook / Microsoft 365 mailer in WP Mail SMTP) instead of entering an SMTP password.

The final step is to click “Save changes”.

Test sending email with Easy SMTP

First, open the Test Email tab:

  • To: the recipient’s email address
  • Subject: the email subject
  • Message: the email content

Then click “Send Test Email”.

If you see an error such as “Cannot connect to smtp port”, the SMTP server you entered is wrong. Try a different server.

If the message says “SMTP connect() failed”, something is misconfigured: check the username, app password, port and encryption type, or ask your host whether outgoing SMTP ports are blocked. Google removed the “Allow less secure apps” option in 2022, so Gmail now requires an app password as described above.