# WordPress

## Integration of the WordPress with SMTP EmailLabs <a href="#docs-internal-guid-e8d8c47c-7fff-ba64-809e-57ae693c795e" id="docs-internal-guid-e8d8c47c-7fff-ba64-809e-57ae693c795e"></a>

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.<br>

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**.

<figure><img src="https://1834454488-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxRBDHL4zFAAFTf3m7JIr%2Fuploads%2FtlB6AhN3hQcO0gcu5VvG%2FZrzut%20ekranu%202025-03-26%20102051.jpg?alt=media&#x26;token=efc85dc3-05d9-4327-890f-823d1abdf3aa" alt=""><figcaption></figcaption></figure>

***

### 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.<br>

{% stepper %}
{% step %}

#### 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.
  {% endstep %}

{% step %}

#### Easy WP SMTP Configuration

* Go to **Easy WP SMTP -**> **Settings**.
* In the **Mailer Settings** section, select **Other SMTP**.

<figure><img src="https://1834454488-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxRBDHL4zFAAFTf3m7JIr%2Fuploads%2FMmU2mWnri2SoYOLkTfXE%2Fimage%20(17).png?alt=media&#x26;token=7ef4508e-e7fb-4bb5-bc9f-2f37998aa9f3" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Configuring EmailLabs SMTP Server Details

1. Fill out the configuration form with the data received from EmailLabs:
   * S**MTP 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.

<figure><img src="https://1834454488-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxRBDHL4zFAAFTf3m7JIr%2Fuploads%2FPm81frVvnzN4Sarb6qqv%2Fimage%20(16).png?alt=media&#x26;token=d54b2779-769d-45bb-877c-a2740563f9c7" alt=""><figcaption></figcaption></figure>

2. In the "General Settings" section, add:
   * **From Email Address**
   * **From Name**

<figure><img src="https://1834454488-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxRBDHL4zFAAFTf3m7JIr%2Fuploads%2FHxN7ekYAiThq2lLWCqSP%2Fwordpress.png?alt=media&#x26;token=8757117a-9682-44fe-b059-6f20d1a0a04f" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}
Saving the Configuration

Click **Save settings** to save the data.
{% endstep %}
{% endstepper %}

***

### 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.&#x20;

{% stepper %}
{% step %}

#### 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.
  {% endstep %}

{% step %}

#### 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).

<figure><img src="https://1834454488-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxRBDHL4zFAAFTf3m7JIr%2Fuploads%2FqIqTAFxQVoRItYCZPTB2%2Fhttps___files.gitbook.com_v0_b_gitbook-x-prod.appspot.com_o_spaces_2FxRBDHL4zFAAFTf3m7JIr_2Fuploads_2FMHv9Cvp2hxeZLgCN9CKR_2Fscreenshot-1.avif?alt=media&#x26;token=76f55bb3-af6b-4e5e-a00f-a333153abb92" alt=""><figcaption></figcaption></figure>

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

<figure><img src="https://1834454488-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxRBDHL4zFAAFTf3m7JIr%2Fuploads%2FadZIC3DdynLnBa7Submv%2Fhttps___files.gitbook.com_v0_b_gitbook-x-prod.appspot.com_o_spaces_2FxRBDHL4zFAAFTf3m7JIr_2Fuploads_2FhC1PmxDxhThgBvuJse0F_2Fscreenshot-2.avif?alt=media&#x26;token=efa90f43-874b-42c9-96b4-40d511d993b0" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### 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.

<figure><img src="https://1834454488-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxRBDHL4zFAAFTf3m7JIr%2Fuploads%2F4wkhYTIvdcSK0thtbAdz%2Fimage.avif?alt=media&#x26;token=64c977ed-0d0c-44a9-b282-31780d5951e4" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### 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.&#x20;
{% endstep %}
{% endstepper %}
