WordPress

Integration of the WordPress with SMTP EmailLabs

WordPress is one of the most popular solutions in the field of content management systems (CMS), which enables the creation of websites, online stores and blogs. The extraordinary flexibility of WordPress allows for integration with various plugins, including those that enable sending emails, such as thank you messages for filling out a form or newsletter subscription confirmations. However, when we want to change the traditional host SMTP server to an external service, e.g. EmailLabs, we may face some challenges.

If we decide to change the SMTP server in WordPress, it is worth using ready-made plugins that enable quick and efficient setup. Alternatively, if you're a developer, you can customize the configuration yourself. Below we'll guide you through both methods.

Finding SMTP data in EmailLabs

The data needed for integration via SMTP can be found in the EmailLabs panel in the section: Email API -> Settings -> SMTP Accounts.


Integration using the "Easy WordPress SMTP" plugin

Below you will find steps describing the process of integrating WordPress with EmailLabs using the Easy WP SMTP plugin, which will enable effective delivery of emails from your site.

1

Installation of the Easy WP SMTP Plugin

  • The first step is to install the Easy WP SMTP plugin on your site.

  • Go to Plugins -> Add new plugin and search for "Easy WP SMTP".

  • Then install and activate the plugin on your site.

2

Easy WP SMTP Configuration

  • Go to Easy WP SMTP -> Settings.

  • In the Mailer Settings section, select Other SMTP.

3

Configuring EmailLabs SMTP Server Details

  1. Fill out the configuration form with the data received from EmailLabs:

    • SMTP Host: smtp.emaillabs.net.pl

    • Type of Encryption: Select "TLS" or "SSL" depending on your preference.

    • SMTP Port: 587 (with TLS), 465 (with SSL).

    • SMTP Authentication: Check "On".

    • SMTP Username: Enter your EmailLabs SMTP account name in the format 1.youraccountname.smtp.

    • SMTP Password: The SMTP password set in the EmailLabs panel.

  1. In the "General Settings" section, add:

    • From Email Address

    • From Name

4

Saving the Configuration

Click Save settings to save the data.


Configuration using Code (without a plugin)

Open the functions.php file in your WordPress template. Paste the following code, adjusting it to your data:

add_action(’phpmailer_init’,’send_smtp_email’);
function send_smtp_email( $phpmailer )
{
 
        	// Information that we are sending via SMTP
 
         	$phpmailer->isSMTP();
 
        	// SMTP server name
 
        	$phpmailer->Host = „smtp.emaillabs.net.pl”;
 
       	        // SMTP authentication (true/false)
 
        	$phpmailer->SMTPAuth = true;
 
      	        // SMTP port number – 25 (no encryption),
 
                //587 (tls encryption)12          $phpmailer->Port = „587”;
 
     	        // EmailLabs smtp account name
 
     	       $phpmailer->Username = „ACCOUNT NAME”;
 
     	        // EmailLabs smtp account password
 
      	        $phpmailer->Password = „PASSWORD”;
 
     	        // Connection encryption – tls
 
                // or do not call the method
 
                $phpmailer->SMTPSecure = „tls”;
 
    	        $phpmailer->From = „Your email address”;

After successful configuration, perform a test email send to ensure that the integration works correctly.


Integration using the "WP Mail SMTP" Plugin

With the following steps, your WordPress will be successfully integrated with an external SMTP server using the WP Mail SMTP plugin. This will allow you to improve email deliverability and take advantage of the advanced features available in EmailLabs.

1

Logging into WordPress and Plugin Installation

  • Log in to the WordPress administration panel.

  • From the left-hand menu, navigate to: Plugins -> Add New.

  • Search for "WP Mail SMTP", then install and activate the plugin offered by WPForms.

  • After activation, go to the WP Mail SMTP plugin settings.

2

Entering Initial Plugin Settings

Fill in the following fields in the plugin's general settings section:

  • From Email: Enter the email address from which emails will be sent.

  • Force From Email: Check this box.

  • From Name: Enter the name to be displayed as the sender.

  • Force From Name: Check this box if you want to force the From Name.

  • Return Path: Check this box (recommended to receive information about undelivered emails).

Next, for "Mailer", select the option: Other SMTP.

3

Configuring EmailLabs SMTP Server Details

Configure the plugin settings using the information received from EmailLabs:

  • SMTP Host: smtp.emaillabs.net.pl

  • Encryption: Select your preferred encryption method:

    • TLS (recommended)

    • SSL

  • SMTP Port: Enter the appropriate port depending on the selected encryption:

    • 587 for TLS (recommended)

    • 465 for SSL

  • Authentication: Select the ON option. (If this option is turned off, the SMTP username and password fields will not be available).

  • SMTP Username: Enter your EmailLabs SMTP account name in the format 1.youraccountname.smtp.

  • SMTP Password: Enter the SMTP password set in the EmailLabs panel.

4

Testing and Saving the Configuration

Once all the data has been entered correctly, click the Save and Continue button. Perform a test by sending an email from your WordPress system, for example using the "Example email" function, and check whether the message has been delivered correctly.

Last updated