How To Configure WordPress to Use SMTP for Sending Emails

How To Configure WordPress to Use SMTP for Sending Emails

Learn how to set your WordPress application to send mails via SMTP

By Default, WordPress uses the PHP Mail function to send its emails. There's nothing wrong with that but if you want to use a third-party email service, in some cases you will be forced to use SMTP for sending your emails.

To begin, first you need to install a plugin named WP Mail SMTP. Once the plugin is installed and activated, a new menu will show up under the Settings section called Email. You will need to navigate to it in order to configure WordPress to work with SMTP.

On this screen you will see numerous configuration options available for you.

Here's a list of all of them and what do they configure:

  • From Email - the email address you want to send emails from - email@yourdomain.com for example;
  • From Name - the name that your emails will be received from;
  • Mailer - choose whether you want to use the default Mail function or the SMTP;
  • Return Path - check if you want to match the return path for your emails to the sending email;
  • SMTP Host - the hostname for your SMTP server;
  • SMTP Port - the port your server works on;
  • Encryption - if you have SSL/TLS encryption available for that hostname, select it here;
  • Authentication - check if your SMTP server requires authentication;
  • Username - the username for your SMTP server;
  • Password - the password for your SMTP server;

Once you configure those parameters, simply click the Save button at the bottom of the page. That's it, WordPress is now configured to work with your SMTP Server!


cPanel - eMail Track Delivery

This Interface of cPanel is used to see delivery reports of emails. This interface can show the errors, while sending your email. You can also see spam scores of your emails. A spam score is provided by Apache Spamassassin. You can also check the emails delivery route to help you identify any problems in the delivery attempt.

To track an email delivery, open cPanel Track Delivery by clicking on Track Delivery link found in the Email Section of cPanel.

In track Delivery interface, you will see a table of email sending events.

If you wish to filter the table for a single recipient email, you may do so by entering a recipient’s email in Recipient Email (optional), and then click Show All button to show the email related to a specific recipient. To view all emails again, remove the email from Recipient Email and Click Show All, it will again show all the records.

There are four main types of filters, which you can apply to a list.

  • Show Success − This will show all the emails that are successfully delivered to the destination.
  • Show Deferred − This will show you all emails with a warning, which are the system deferred emails.
  • Show Failures − It will show you the emails, which are not delivered to the destination. It will also show any other errors during transmission of emails.
  • Show In–Progress − This will show you all the emails, which are currently transmitting.

You can combine these filters too as and how they are required.

The following table shows the default information about emails −

Sr.No Emails & Description
1 Event

This column shows icon of success, failure or deferred emails.

2 Sender

It shows the email address of email sender.

3 Sent time

It shows the date and time on which email was sent.

4 Spam Score

It shows Apache Spamassassin spam score.

5 Recipient

It shows the email of recipient.

6 Result

Important column − it shows the error encountered by the system, while sending the email. This message describes the delivery results

7 Action

An information Icon, which on clicking shows the details of the report.

To view more information of an email delivery report, click information icon shown at the action column next to the corresponding report.

And you will see the details of the delivery record as shown below.


Cpanel - Autoreponders

You can add or modify Autoresponders for your email accounts through this interface. You can configure an email to send an automated reply to all emails you receive to your email account. You can make an automated reply to say that you have received the email and you will reply soon.

If you are on vacation, you can configure the Autoresponders to reply that you are not available at this moment etc. you can also set a specific duration of time in which the automated reply will be sent.

Add an Autoresponder

To add an autoresponder, follow these steps −

Step 1 − Open cPanel Autoresponders by clicking on Autoresponder link found in Email section of cPanel Home.

Step 2 − Click Add Autoresponder in this section. It will take you to Modify/Add Autoresponders.

Step 3 − Choose character set, recommended is that you leave it as it is, which is utf–8.

Step 4 − Enter the number of hours to wait between responses to same email address, this helps in preventing sending same email to same user multiple times.

Step 5 − Enter Email and select Domain for which you want to add an autoresponder.

Step 6 − Enter outgoing email’s sender name, it may be your name or your company’s.

Step 7 − Enter Subject of your outgoing Email. You may keep it same as incoming email by putting %subject% in Subject, you can provide your custom subject too.

Step 8 − Enter Body of your Email. You may use %from%, which will be the name of sender, if available. You may use %email% in body too, it will be the email address of the sender.

Step 9 − Select This message contains HTML checkbox, if there is HTML in your Email Body.

Step 10 − Schedule a Start, End Date, and Time for your autoresponder email. You can choose to start immediately or on a specific date at a specific time. You can choose this autoresponder to stop sending emails on a specific day, or you can choose never to stop an autoresponder. You can change this configuration anytime.

Step 11 − Press Create/Modify button to create an autoresponder.

Edit or Delete Autoresponder

To edit or delete an autoresponder, find the Current Autoresponder by scrolling down in Autoresponder section.

Click Edit corresponding to the autoresponder to edit and it will take you to the same interface, which we have gone through when creating the Autoresponder. You can use the same interface to make the change.

To delete an autoresponder, click Delete corresponding to that autoresponder. It will ask you for confirmation, click Delete to delete that autoresponder.


cPanel - Autoresponders

You can add or modify Autoresponders for your email accounts through this interface. You can configure an email to send an automated reply to all emails you receive to your email account. You can make an automated reply to say that you have received the email and you will reply soon.

If you are on vacation, you can configure the Autoresponders to reply that you are not available at this moment etc. you can also set a specific duration of time in which the automated reply will be sent.

Add an Autoresponder

To add an autoresponder, follow these steps −

Step 1 − Open cPanel Autoresponders by clicking on Autoresponder link found in Email section of cPanel Home.

Step 2 − Click Add Autoresponder in this section. It will take you to Modify/Add Autoresponders.

Step 3 − Choose character set, recommended is that you leave it as it is, which is utf–8.

Step 4 − Enter the number of hours to wait between responses to same email address, this helps in preventing sending same email to same user multiple times.

Step 5 − Enter Email and select Domain for which you want to add an autoresponder.

Step 6 − Enter outgoing email’s sender name, it may be your name or your company’s.

Step 7 − Enter Subject of your outgoing Email. You may keep it same as incoming email by putting %subject% in Subject, you can provide your custom subject too.

Step 8 − Enter Body of your Email. You may use %from%, which will be the name of sender, if available. You may use %email% in body too, it will be the email address of the sender.

Step 9 − Select This message contains HTML checkbox, if there is HTML in your Email Body.

Step 10 − Schedule a Start, End Date, and Time for your autoresponder email. You can choose to start immediately or on a specific date at a specific time. You can choose this autoresponder to stop sending emails on a specific day, or you can choose never to stop an autoresponder. You can change this configuration anytime.

Step 11 − Press Create/Modify button to create an autoresponder.

Edit or Delete Autoresponder

To edit or delete an autoresponder, find the Current Autoresponder by scrolling down in Autoresponder section.

Click Edit corresponding to the autoresponder to edit and it will take you to the same interface, which we have gone through when creating the Autoresponder. You can use the same interface to make the change.

To delete an autoresponder, click Delete corresponding to that autoresponder. It will ask you for confirmation, click Delete to delete that autoresponder.


cPanel - MX Entry

This feature of cPanel allows to route all your emails to a specific server. Changes you make here also get reflected in the domain’s DNS entries. This feature is important to create a backup server for your domain’s mail server to receive when your main server is down. You can setup MX entries here to route your mail to Google mail servers when you use Google Apps to manage your emails.

Use this interface to manage your MX entries and Email Routing

Configure Email Routing

To configure the email routing for your domain, follow these steps −

Step 1 − Open cPanel MX Entries by clicking MX Entry from Email Section of cPanel Interface.

Step 2 − Select the domain for which you want to configure Email Routing.

Step 3 − When you will select the domain from the drop down, Email Routing setting will appear. The current applied setting is displayed bold.

Step 4 − Change your current setting only when you need it. Select any of these four options according to your need.

  • Automatically Detect Configuration − This enables the cPanel to automatically detect the best settings according to priorities of your MX records.
  • Local Mail Exchanger − This enables your server to receive emails, even if any MX entry of higher priority is found. In this case, emails are sent to both domains.
  • Backup Mail Exchanger − In this case, your server acts as backup mail exchanger and if your primary mail exchanger is offline, then it holds the emails until your primary server is back online. You need to have a proper MX Entry for your primary mail exchanger.
  • Remote Mail Exchanger − In this case, your domain does not accept any mail and reroutes them to your primary email server.

Step 5 − Click Change and your new setting will appear in bold letters.

Add an MX Record

To add a, MX record, follow these steps −

Step 1 − Scroll down to Add New Record on MX Entry page.

Step 2 − Enter Priority of MX record, lower the number – higher the priority. Zero has the highest Priority.

Step 3 − Enter Destination Domain to which you want to reroute your emails.

Step 4 − Click Add New Record to add a new MX record.

Edit or Remove an MX Record

To edit or remove click Edit or Remove link in Actions corresponding to the MX entry that you want to edit or delete.

When you will click Edit, it will ask you for the Priority and Domain, change what you need to change and finally click Edit to save the changes.

When you click Remove link, it will ask you for confirmation. Click Delete to remove the entry.


cPanel - Webmail

Webmail is a web-based email client, which allows you to access your emails through any browser or any computer. This is very helpful when you do not have access to your computer on which your email is setup, you can login to your account from anywhere to read your emails and to quickly respond.

Opening Your Webmail

There are two options through which you can login to your webmail client.

Through cPanel Interface

Follow these steps to login to your webmail client −

Step 1 − Login to your cPanel and click on Email Accounts found under the Email section.

Step 2 − Scroll down to find list of Email Accounts.

Step 3 − Click on More button at the corresponding email address of which you want to access webmail.

Step 4 − Click on Access Webmail and the system will automatically log you into the webmail in a new tab.

Step 5 − Choose any Webmail application. You can also set a default Webmail application, so whenever you log into your webmail, your default webmail application will automatically load.

Note − I have chosen horde to load webmail

Access webmail directly

To access webmail directly without logging into cPanel, you can use the following steps −

Step 1 − Navigate to https://your–domain.com:2096 or https://webmail.your–domain.com through your browsers address bar.

Step 2 − Webmail login screen will appear, Enter your Email and Password of your email account.

Step 3 − Press Log in button to login into your web based email client, you will get same interface as we got above.


cPanel - Email Forwarders

You can create multiple email account in your cPanel email as per your need. When the number of emails accounts get higher, you will need to open each account to view the emails received. To overcome this issue, you can forward the copy these emails of one account to another account, so now you will have to only open one account to view all the emails. You can also discard the email or send it to a program. You can also forward all the emails of your domains to another domain.

Create an Email Forwarder

There are two types of forwarders available, first to forward an email account to another one. Second is to forward all emails to a domain.

Create an Email Account Forwarder

Step 1 − Open Email Forwarders by clicking on the link of Forwarders found in cPanel Home.

Step 2 − In the Forwarders Interface, you will find Create an Email Account Forwarder.

Step 3 − Press Add Forwarder Button, it will take you to a similar interface like this.

Step 4 − Enter the Address of the email which you want to forward. It is not necessary that the email must be already created. If you do not create an email and forward it to somewhere, the only difference will be that your emails will not be stored in the mailbox of the original email, because that mailbox will not exist.

Step 5 − Enter destination where you want your email to be forwarded.

  • Select Forward to Email Address and fill the textbox with an existing email, where you want your emails to be received.
  • Select Discard and send an error to sender. If you want to discard that message and supply a failure message to sender. You can also customize the Failure message, enter the message in textbox.

In Advance Options −

  • Select Forward to a System Account, if you want your emails to be sent to a system account, and provide a system account name.
  • Select Pipe to a program, if you want your emails to send to a program and enter path name of your program with file extension.
  • Select Discard and system will simply discard the email and will do nothing. Select your choice accordingly.

Step 6 − Click Add Forwarder to save the changes you made.

Add Domain Forwarder

You can forward all the emails of your domain to another domain. On the domain, who will receive the emails, you can change the default email address of that domain to a single email, which then can receive all the emails sent from your domain of which you forwarded the emails.

Step 1 − Click on Add Domain Forwarder button, which can be found underCreate an Email Forwarder of Forwarder interface.

Step 2 − In Add New Domain Interface, select the domain you want to forward.

Step 3 − In the textbox next to your domain, enter the domain on which you will be receiving the emails.

Step 4 − Press Add Domain Forwarder button to save the changes.

Delete an Email Forwarder

To delete an email forwarder, click on delete link corresponding to the forwarder you want to delete.

For Email account forwarder −

For Domain Forwarders −

It will ask for your permission before deleting the forwarders, click Delete Forwarder to delete the Email Forwarder


cPanel - Email Accounts

You can create and manage email accounts of your domain through this interface. You can Create email address, configure your mail client, change your passwords and access your webmail directly.

Create an Email Address

To create an email address for your domain, follow these steps −

Step 1 − Click on Email Accounts link found in your Emails section of the cPanel Home.

Step 2 − In Email Accounts, you will find Add Email Account on the Top.

Step 3 − Add Email name you want to create as it will be the text that comes before @.

Step 4 − Choose a strong password and supply Mailbox Quota. It defines how much disk space this account can use. You can provide specific amount of space in MB or you can provide an unlimited quota for this.

Step 5 − Click on Create Account to create an Email address associated with your domain.

Manage Email Accounts

You can manage your email accounts through this interface, you can change your passwords, change quota amount or delete the email account.

To manage your email accounts, scroll down to see the list of Email accounts that exist with your domain.

Change Passwords

To change your email accounts password, click Change Password link corresponding to your email address.

Enter New Passwords, and save changes by pressing Change Password button.

Change Quota

To change your email quota, click on link Change Quota corresponding to your email address that you want to manage.

Enter limited quota in Megabytes or select unlimited option. Press Change Quota Button so save the changes.

Configure Mail Client

To send and receive emails with your domain from any desktop or mobile email client, e.g. Windows Live Mail, Outlook or iOS of iPhone etc. cPanel provides you preconfigured setting for these applications. You just need to download the settings and run it, then it will automatically configure the email client. You may need to enter your email account password. You can also manually configure the email clients for sending and receiving emails for your email client.

To download Auto Configuration Scripts or See the manual settings, click on Configure Mail Client link corresponding to your email account.

Once the interface is opened, you will see Auto Configuration Scripts.

You can download Auto Configuration Scripts for Configure mail client interface. Just download the appropriate settings and run it.

Or if you want to configure your mail client manually, you can scroll down to see the Manual Settings.

Note − There are four types of settings – IMAP and POP3, both over SSL/TLS and Non-SSL too. Using SSL sends your messages with encryption providing extra layer of security, but Non SSL does not. It is recommended that you use settings with SSL. From IMAP or POP3, you can choose anyone you want. Both will work perfectly.

Delete an Email Account

To delete an email account, just click on Delete link corresponding to your email account.

It will ask for confirmation. Press the Delete Button to remove your email account.


cPanel - Email Filters

Email filters are useful to create rules to block unwanted emails, based on certain rules you choose. You can specify some rules like a message containing a specific word should be deleted or passed to a specific program. These filters work subsequently, for example if a mail passes through a filter, but can be blocked by another filter. You can specify multiple rules in one filter too.

There are two types of Email Filters in cPanel − User Level Filter and Account Level Filter.

User Level Filter

Through this user level filter, you can create email filters, which will apply on emails that will be received by that email address.

Create a User Level Filter

To create a user level email filter, follow these steps −

Step 1 − Open user level email filters by clicking on Email Filter found under Email section of cPanel.

Step 2 − In Email Filters, you will see the list of emails associated with your domain. Click on Manage Filter link corresponding to your email on which you want to create a filter.

Step 3 − Click on Create New Filter button to go to a new filter creation interface.

Step 4 − Provide a name for your filter.

Step 5 − Select rules for filtering your message. To add additional rules, click on Add (+) button on right side, to remove rules click Subtract (–). Also choose ‘and’ or ‘or’ rule.

Step 6 − Select an Action for a message those passes to the rules of filter. To add additional rules, click on Add (+) button on right side, to remove rules click Subtract (–).

Step 7 − Click on Create button to create a filter.

Edit or Delete a User Level Filter

To edit or delete a user level filter −

Step 1 − Return to Email Filter Interface.

Step 2 − Choose the email for which you want to edit or delete the Filter from Current Filters.

Step 3

  • To Edit, click Edit Link and you will be taken to the same interface we went through to create an Email Filter. Click Save to Save the Email Filter.
  • To Delete the Email Filter, click on Delete link and you will be asked for confirmation. Click Delete to delete an Email Filter.

Testing an Email Filter

To test the filter, you can follow these steps −

Step 1 − Return to Email Filters Interface and Click on the Manage link corresponding to email address of which you want to test filter.

Step 2 − Scroll down to find Filter Test.

Step 3 − Enter complete Email with headers and subjects in Filter Email text input.

Step 4 − Press Test Filter and the system will generate a full report of how the filters will respond to the email you have written.

Account Level Filtering

The only difference in User Level Filtering and Account Level Filtering (or Global Email Filtering) is that the filters used in Account Level Filter will filter all emails received in your domain, no matter to which email address the message was sent.

To Create and Manage Global Email Filter click on Global Email Filter found under Email section of cPanel Home.

Process to Create, Manage and Test a Global Email Filter is same as we studied above in User Level Filtering. Only difference is that you will not find a list of Emails to choose to Manage, but you will get a list of all Global Email Filters.


cPanel - Authentications

Email Authentications prevent the email from going into the spam folder of recipients. cPanel uses DKIM and SPF to reduce the amount of spam mails. Enabling these features will prevent spammers from forging messages that claims to be coming from your domain.

DKIM

Domain Key Identification Mechanism (DKIM) verifies your incoming emails to check whether they are same as they were before when they were sent. This means, if they are altered during the transit. It also checks whether they are from the same address, whom they claim to be. This feature prevents incoming spam emails.

When DKIM is enabled, the sender signs the email with a digital signature using a private key. When the email approaches the recipient, it retrieves the public key of its sender and checks if the signature matches. If the signature is invalid, then message is treated as a spam message.

Enabling DKIM

To enable DKIM follow these steps −

Step 1 − Open Email Authentication by clicking Authentication found under Mail Section of cPanel Home.

Step 2 − Find DKIM settings, if disabled then, click Enable button to Enable DKIM.

Disable DKIM

To disable DKIM follow these steps −

Step 1 − Open Email Authentication by clicking Authentication found under Mail Section of cPanel Home.

Step 2 − Find DKIM setting, if enabled, then click Disable button to Disable DKIM.

Note − To Enable DKIM, your Nameservers must point to your hosting. It is recommended that you use DKIM Authentication in your hosting.

SPF

Sender Policy Framework (SPF) helps in preventing outgoing messages to spams. This helps to prevent spammers in creating a message that looks like it is originated through your domain. SPF uses TXT type DNS resource records, which specify the hosts that send emails through your domain.

Enable SPF

To enable SPF, follow these steps −

Step 1 − Open Email Authentication by clicking Authentication found under Mail Section of cPanel Home.

Step 2 − Find SPF setting, if disabled, then click Enable button to Enable SPF.

Disable SPF

To disable SPF, follow these steps −

Step 1 − Open Email Authentication by clicking Authentication found under Mail Section of cPanel Home.

Step 2 − Find SPF setting, if enabled, then click Disable button to disable SPF.