---
title: I cannot connect to an SMTP server
description: This page helps you understand and fix the connection to an SMTP server
tags: transactional email smtp smtp-server connection troubleshooting
dates:
  validation: 2026-05-05
  posted: 2026-05-05
---

## Problem

I cannot connect to an SMTP server.

## Cause

- The SMTP ports are disabled.
- Using wrong credentials (e.g., email address as username instead of the Project ID).

## Solution 

### Enable SMTP ports on a Scaleway Instance

By default, the SMTP ports (587, 465, and 2465) are disabled on all Scaleway Instances. To enable them:
1. Click **CPU & GPU Instances** in the **Compute** section of the side menu. The [Instances page](https://console.scaleway.com/instance/servers) displays.
2. Select the Availability Zone (AZ) from the drop-down menu (e.g., `PAR1`) to view resources in the selected AZ.
3. Click the **Security groups** tab. The **Security groups** dashboard displays.
4. Click the security group you want to edit.
5. Tick the **Enable SMTP** box to allow outgoing emails.

### Enable SMTP ports on other environments

|     Environment      |                                                                                     How to enable SMTP                                                                                      |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Serverless Container | No action required. SMTP ports are blocked on Serverless Containers except for Transactional Email.                                                                    |
| Serverless Function  | Read our [tutorial to send emails with Transactional Email and Serverless Functions using the Serverless Framework](/tutorials/send-emails-tem-serverless-framework/) for more information. |
| Kubernetes           | Enable SMTP via Public Gateway and Security group of nodes.                                                                                                                                      |

### Verify your SMTP credentials

Make sure you use the correct credentials:
- Hostname : `smtp.tem.scaleway.com`
- Port : `587` (STARTTLS), `465` (SSL), or `2465` (TLS)
- Username : your Project ID
- Password : your API Token with [Transactional Email permissions](/iam/reference-content/permission-sets/#transactional-emails)