# How to configure SMTP

B2CORE requires an active SMTP service to send email notifications to your clients. For optimal performance, select an SMTP provider that offers high deliverability and doesn’t impose strict daily sending limits.

{% hint style="warning" %}

### SMTP providers to use and to avoid

Don't use **Gmail**, **Office 365**, **Outlook.com**, **Yahoo**, or similar providers. These services impose strict daily sending limits and aren't designed for bulk or transactional email delivery.

For reliable performance and scalability, use dedicated SMTP providers such as [Mailchimp](https://mailchimp.com/), [SendGrid](https://sendgrid.com/), or [Mailgun](https://www.mailgun.com/).
{% endhint %}

The following information is required to configure the SMTP service connection via the B2CORE Back Office:

* SMTP hostname
* SMTP port
* SMTP username
* SMTP password

## How to sign up with an SMTP service provider

This instruction describes how to sign up with an SMTP service provider (using the [Mailgun](https://www.mailgun.com/) provider for illustration purposes). You can choose any SMTP service provider that you want to use and configure the SMTP settings by following your provider’s instructions.

{% hint style="info" %}
This instruction is created based on the latest version of Mailgun as of this writing. Due to possible changes to the procedures described here, we suggest that you consult the official [Mailgun Help Center](https://help.mailgun.com/hc/en-us) or contact their support in case you have any questions.
{% endhint %}

{% stepper %}
{% step %}
Go to the [Mailgun](https://www.mailgun.com/) website and click **Get Started**.
{% endstep %}

{% step %}
Fill in the required fields, including your full name, email address, and payment information, select a plan that you want to use for the SMTP service, and then click **Create Account**.
{% endstep %}

{% step %}
On the main [Mailgun](https://www.mailgun.com/) web page, click **Log In** and log in to Mailgun with your credentials.
{% endstep %}

{% step %}
Navigate to **Sending** > **Domains** and click **Add New Domain**.
{% endstep %}

{% step %}
Fill in the following information:

* In the **Domain name** field, enter your company domain.
* Select a domain region.
  {% endstep %}

{% step %}
Click **Add Domain**.
{% endstep %}

{% step %}
Navigate to **Sending** > **Domain settings**.
{% endstep %}

{% step %}
Select your domain name in the **Domain** dropdown located at the top of the page, and then go to the **DNS records** tab.
{% endstep %}

{% step %}
Add the following DNS records and assign to them the appropriate values via your DNS hosting provider.

* two TXT records
* two MX records
* one CNAME record

Copy the record names and values displayed in the **Hostname** and **Enter this value** columns on the **DNS records** tab and paste them in the corresponding fields when adding DNS records via the DNS hosting provider.

Green checkmarks displayed on the left side of each record indicate that the record has been set up properly.
{% endstep %}

{% step %}
Navigate to **Sending** > **Overview** > **SMTP** to view your SMTP hostname, port, username, and default password. Use this information to configure the Mailgun SMTP connection via the B2CORE Back Office.
{% endstep %}
{% endstepper %}

## How to configure an SMTP service connection via the B2CORE Back Office

{% stepper %}
{% step %}
Navigate to **Mailing** > **System** > **Providers**, and click **+Create** in the upper-right page corner.
{% endstep %}

{% step %}
Configure the SMTP connection settings:

* In the **Caption** field, enter a caption that you want to use for the SMTP configuration.
* Make sure that the **Driver** field displays “smtp”.
* In the **Host** field, enter an SMTP service hostname.
* In the **Port** field, enter a port number to be used for the SMTP connection.
* In the **Username** and **Password** fields, enter your SMTP service credentials.
* In the **Sent from** field, enter an email address that will be displayed to your email recipients.
* In the **Sent from name** field, enter a name that you want to display to your email recipients (for example, this may be your company name).
* In the **Encryption** dropdown, select **TLS** or **SSL** to enable a secure connection when communicating with the SMTP service. Choose **Not selected** to disable encryption.
* In the **Enabled** dropdown, select **enabled** to make the SMTP service connection active.
  {% endstep %}

{% step %}
Click **Test Connection** to confirm that you can connect to the SMTP service with the current settings. The **Test Connection** button is highlighted with green if the connection is successful.
{% endstep %}

{% step %}
Click **Save**.
{% endstep %}
{% endstepper %}

The SMTP configuration is now added to the list of email providers.

To quickly test the SMTP configuration that you have set up, go to the B2CORE UI **Sign In** page, and click **Sign up now!** to register a new account. If you already have an account, click **Forget your password?** and then enter your email address. In both cases, you should receive appropriate emails, indicating that your SMTP service connection is properly configured.

To check the status of the recently sent emails, navigate to **Mailing** > **System** > **Log** in the Back Office.
