SMTP query tutorial
Learn how to send email using an SMTP resource.
You're viewing documentation for classic apps, which use Retool's original app editor. The new app builder is the recommended way to build apps and where Retool focuses new development.
After setting up an SMTP integration with Retool, your SMTP resource is available to use in the query editor. An SMTP query sends a single email using the fields you configure below.
Create a query
- Classic app
- Workflow or agent
Retool recommends using the new app builder so you can use natural language to build React-based apps using AI.
To create an SMTP query in a Retool app:
- In the Retool app IDE, open the Code tab, then click + in the page or global scope.
- Select Resource query.
- Choose your SMTP resource.
- Configure the email fields and save the query.
Workflows and agent custom tools use the same Resource query block to send email with SMTP.
- Add a Resource query block to your workflow or custom tool's function canvas.
- Choose your SMTP resource.
- Configure the email fields and save the query.
Custom tools use the same block-based canvas as workflows, so the steps are identical in either context.
Query configuration fields
An SMTP query has a single action: send an email. Configure the following fields to compose the message.
From email
The sender address for the email, and optionally a display name.
"Support team" support@example.com
Add reply-to
Enable this option to show a Reply-To field. Set it to an address that should receive replies, if different from the From email address.
replies@example.com