Skip to main content

Send emails

Learn how to send emails using Retool Email or your own SMTP service.

You can send emails to your users from Retool apps and workflows. You can use Retool Email, a built-in SMTP service, or add your own as a resource. If you use Retool Email, emails are always sent from noreply@retool.email.

note

Retool Email is only available on Retool Cloud.

Send emails using Retool Email

note

You can use Retool Email to send up to 120 emails per hour. This limit is applied at the Retool organization level, not the app level.

Retool Email is available as a resource without any configuration required. The steps below explain how to build a basic form to send an email to the provided address.

After you build apps that use Retool Email, you can view usage on the Usage tab in Retool.

1. Create an app

If you haven't created an app yet, log in to Retool and click Create new -> App. Name the app and then click Create app.

2. Add a Form component

Drag a Form component to the canvas, then click Add components. Select Email from the list to add an email field to the form.

3. Create a query

Create a resource query and select Retool Email as the resource. Set the To field to {{email1.value}} so that the email is sent to the address provided in the Email component. Then, fill out the subject and body. You can optionally use Retool's AI feature to draft the body content. Make sure to save the query.

4. Add an event handler

To send the email, you need to add an event handler to the Submit button. Select the button and then click + in the Event handlers section of the Inspector. The default settings should run the query you created, but make sure that:

  • Event is set to Submit.
  • Action is set to Control query.
  • Query is set to the query you created.

5. Test the form

To test the form, enter a valid email address and click the Submit button. If you don't see the email in your inbox, check your spam folder.

Send emails with your own SMTP service

If you have your own SMTP service, you can add it as resource to make it available in Retool apps and workflows.

1. Create an SMTP resource

Follow the Connect to SMTP servers guide to add your SMTP service as a resource.

2. Create an app

If you haven't created an app yet, log in to Retool and click Create new -> App. Name the app and then click Create app.

3. Add a Form component

Drag a Form component to the canvas, then click Add components. Select Email from the list to add an email field to the form.

4. Create a query

Create a resource query and select your SMTP resource. Enter a valid email address in the From field. You can customize the sender name using the format "custom-name" custom-email@domain.com. Set the To field to {{email1.value}}. This passes the email address in the Email component to the query. Then, fill out the subject and body. You can optionally use Retool's AI feature to draft the body content. Make sure to save the query.

Write a query to send emails

5. Add an event handler

To send the email, you need to add an event handler to the Submit button. Select the button and then click + in the Event handlers section of the Inspector. The default settings should run the query you created, but make sure that:

  • Event is set to Submit.
  • Action is set to Control query.
  • Query is set to the query you created.

6. Test the form

To test the form, enter a valid email address and click the Submit button. If you don't see the email in your inbox, check your spam folder.

Add attachments to emails

Whether you use Retool Email or your own SMTP service, you can allow users to add attachments to the emails they send. To do this, add a File Button, File Dropzone, or File Input component to the canvas. Then in the query that sends the email, add the component in the Attachment(s) field. This allows users to upload an attachment using the app, and then automatically add it to the email.

You can also set the Attachment(s) field to the results of a Retool Storage query or any query returning a file object in Retool.