Table of contents
Official Content
  • This documentation is valid for:

With these Public Tools, you can send emails through either Gmail API or any SMTP server. You can also optionally generate a PDF from Markdown content to include as an attachment.

  • com.globant.geai.send_email: Sends emails via the Gmail API using OAuth 2.0. Requires an access token configured in a Secret to authorize the sending account.
  • com.globant.geai.send_email_smtp: Sends emails via a standard SMTP server. Requires SMTP credentials (host, port, username, password) configured in a Secret.

Before using the Tools, you must obtain either a Gmail OAuth 2.0 access token from Google Cloud or SMTP credentials from your email provider and register it as a Secret in your Project.

Configuration steps

send_email

  1. Go to https://console.cloud.google.com/ and sign in.
  2. Create a new project or select an existing one.
  3. Go to APIs & Services > Library and enable the Gmail API for that project.
  4. From the side menu, go to APIs & Services > OAuth consent screen.
  5. Click on Get started, and configure the following:
    • App Information: Enter an App name and a User support email. Click on Next.
    • Audience: Select External (or Internal for organization-only use). Click on Next.
    • Contact Information: Enter your email address. Click on Next.
    • Finish: Accept the "Google API Services: User Data Policy". Click on Continue and then click on the Create button.
  6. From the side menu, go to APIs & Services > Credentials.
  7. Click on Create Credentials. Select OAuth client ID and configure the following:
    • Application type: Select Web application.
    • Name: Enter a descriptive name (for example, GoogleDrive OAuth 2.0 Web App - geai-app).
    • Authorized redirect URIs: Click on Add URI and paste the exact URL:
      • https://console.<your-domain>/oauth_tool_login_callback (for example, https://console.saia.ai/oauth_tool_login_callback).
    • Click on Create. Copy and securely save the Client ID and Client Secret; you will need them to create the Secret in your Project.
  8. If you have not done so already, publish your app from the OAuth consent screen in Google Cloud. This step is required for the credentials to work with external users.
  9. Go to the Console, open the Project where you will use this Tool and create a new Secret. Follow the steps in How to create a Secret.
    • In the Name field, enter a descriptive name (for example, send_gmail). This name will be used later in the token parameter of the Tool.
    • In the Value field, paste the full content of the JSON:
       {
        "id": "globant-enterprise-ai-dev",
        "name": "Gmail OAuth 2.0 Web App - globant-enterprise-ai-dev",
        "type": "oauth2",
        "provider": "google",
        "oAuth": {
          "clientId": "<Client ID>",
          "clientSecret": "<Client Secret>",
          "authorizationUrl": "https://accounts.google.com/o/oauth2/auth",
          "redirectUri": "https://console.saia.ai/oauth_tool_login_callback",
          "tokenUrl": "https://oauth2.googleapis.com/token",
          "authorizationExtraParams": {
            "access_type": "offline",
            "prompt": "consent"
          },
          "scopes": [ "https://www.googleapis.com/auth/gmail.send"
          ]
          }
         }
         
Note: Ensure that the value of redirectUri exactly matches the Authorized redirect URIs configured in Google Cloud OAuth 2.0.

 

Inside the Agent you are creating, go to the AI & Tools Tab, select the Tools and Agents section, and click on + Add. In the left pane, select the desired Tool. Then, select the Tool again in the left pane to view the required parameters, and complete the following:

Parameters

  • email-transport-method: Set email to indicate that the Gmail API with OAuth 2.0 will be used.
  • tools.credentials: Name of the Secret that stores the Google OAuth 2.0 client JSON (for example, send_gmail).

send_email

send_email_smtp

  1. Get your SMTP credentials from your email provider:
    • Host: This is the address of the provider’s SMTP server. For example:
      • Gmail: smtp.gmail.com
      • Outlook: smtp.office365.com
    • Port: Use 587 for TLS or 465 for SSL.
    • Username: Usually your email address (for example, user@example.com).
    • Password: Depends on the provider:
  2. In Console, open the Project where you will use this Tool and create a new Secret. Follow How to create a Secret.

    • In the Name field, enter a descriptive name (for example, email_smtp). You will reference this name in the smtp_credentials_secret parameter of the Tool.
    • In the Value field, paste the credential in the required format.
         {
           "host": "<smtp.example.com>",
           "port": 587, // Supported ports are 587 (TLS) and 465 (SSL)
           "username": "<your_username>",
           "password": "<your_password>" // If using Gmail as SMTP, use an App Password, not your account password. 
         }
         
  3. Confirm to save the Secret.

Inside the Agent you are creating, go to the AI & Tools Tab, select the Tools and Agents section, and click on + Add. In the left pane, select the desired Tool. Then click on the Tool in the left pane to view the required parameters, and complete the following.

Parameters

  • email-transport-method: Set smtp to indicate that an SMTP server with username and password will be used.
  • smtp-credentials: Name of the Secret that stores the SMTP credentials JSON (for example, email_smtp).

send_email_smtp

Availability

Since version 2025-08.

Last update: December 2025 | © GeneXus. All rights reserved. GeneXus Powered by Globant