Skip to main content

Connect to SMTP

SMTP (Simple Mail Transfer Protocol) is the standard protocol for sending email. Connect an SMTP server to Retool to send email from your own mail provider instead of using Retool's built-in email service.

What you can do with SMTP in Retool

After you create an SMTP resource in Retool, you can:

  • Send email: Send plain text, HTML, or Markdown email through your own SMTP server.
  • Attach files: Include file attachments from a component or a storage query.
  • Reply to threads: Set reply-to addresses and thread replies to existing messages.
  • Send to multiple recipients: Address email to multiple recipients using Cc and Bcc.

Before you begin

To connect SMTP to Retool, you need the following:

  • SMTP server details: The hostname and port of an SMTP server that accepts connections from Retool.
  • Retool permissions: Edit all permissions for resources in your organization.

Create an SMTP resource

Follow these steps to create an SMTP resource in Retool.

1. Create a new resource

In your Retool organization, navigate to Resources in the main navigation and click Create newResource. Search for SMTP and click the SMTP tile to begin configuration.

2. Configure general settings

Specify a name and description for the resource that indicates which mail server or provider it connects to. The description provides more context to users and Assist about how to use the resource.

SMTP resource configuration form.

Resource name and description

Choose a name and description that indicate which mail server or provider the resource connects to.

Example nameExample description
Support mailboxSMTP server used to send email from the support team's mailbox.
Notifications SMTPSMTP server for transactional and system notification email.

3. Configure resource credentials

Configure the connection settings for your SMTP resource.

Host

The hostname or IP address of your SMTP server.

Example
smtp.example.com

Port

The port your SMTP server listens on.

Example
25

Username and password

The username and password Retool uses to authenticate with your SMTP server. Leave both fields blank if your SMTP server allows unauthenticated connections.

Example
Username: notifications@example.com
Password: ••••••••
Store credentials securely

Store the password in a configuration variable or Retool secret rather than typing it directly into the field.

4. Configure advanced options

Outbound region

If your organization uses outbound regions, select the region that should be used for requests to your SMTP server. This controls which geographic region your requests originate from.

5. Test the connection

Click Test connection to verify Retool can connect to your SMTP server. If the test succeeds, you see a success message. If it fails, check the following:

  • Host and port: Confirm the hostname and port match your SMTP provider's documentation.
  • Network access: Confirm your SMTP server accepts connections from Retool, and add Retool's IP addresses to your server's allowlist if necessary.
  • Credentials: Confirm the username and password are correct, or that your server permits unauthenticated connections if you left them blank.

6. Save the resource

Click Create resource to save your SMTP resource. The resource is now available to use in apps, workflows, and agent tools across your Retool organization.

Interact with SMTP data

Once you've created an SMTP resource, you can interact with SMTP using Retool.

Switch to the new app builder

Retool recommends using the new app builder so you can use natural language to build React-based apps using AI.

Best practices

Follow these best practices to maintain the security of your SMTP resource.

  • Use encrypted connections: Use a port and server configuration that supports TLS or STARTTLS, and confirm with your mail provider that connections are encrypted in transit.
  • Rotate credentials regularly: Follow your mail provider's recommendations for password rotation.
  • Use a dedicated mailbox: Authenticate with a mailbox created specifically for application email rather than a personal or shared inbox, so you can limit its permissions and monitor its activity independently.
  • Use resource environments: Organizations on an Enterprise plan can configure multiple resource environments to maintain separate SMTP credentials for production, staging, and development.