Smtp2go

Learn how to use Smtp2go with Composio

Overview

SLUG: SMTP2GO

Description

SMTP2GO is a reliable email delivery service that ensures your emails reach recipients’ inboxes efficiently.

Authentication Details

generic_api_key
stringRequired

Connecting to Smtp2go

Create an auth config

Use the dashboard to create an auth config for the Smtp2go toolkit. This allows you to connect multiple Smtp2go accounts to Composio for agents to use.

1

Select App

Navigate to Smtp2go.

2

Configure Auth Config Settings

Select among the supported auth schemes of and configure them here.

3

Create and Get auth config ID

Click “Create Smtp2go Auth Config”. After creation, copy the displayed ID starting with ac_. This is your auth config ID. This is not a sensitive ID — you can save it in environment variables or a database. This ID will be used to create connections to the toolkit for a given user.

Connect Your Account

Using API Key

1from composio import Composio
2
3# Replace these with your actual values
4smtp2go_auth_config_id = "ac_YOUR_SMTP2GO_CONFIG_ID" # Auth config ID created above
5user_id = "0000-0000-0000" # UUID from database/app
6
7composio = Composio()
8
9def authenticate_toolkit(user_id: str, auth_config_id: str):
10 # Replace this with a method to retrieve an API key from the user.
11 # Or supply your own.
12 user_api_key = input("[!] Enter API key")
13
14 connection_request = composio.connected_accounts.initiate(
15 user_id=user_id,
16 auth_config_id=auth_config_id,
17 config={"auth_scheme": "API_KEY", "val": {"generic_api_key": user_api_key}}
18 )
19
20 # API Key authentication is immediate - no redirect needed
21 print(f"Successfully connected Smtp2go for user {user_id}")
22 print(f"Connection status: {connection_request.status}")
23
24 return connection_request.id
25
26
27connection_id = authenticate_toolkit(user_id, smtp2go_auth_config_id)
28
29# You can verify the connection using:
30connected_account = composio.connected_accounts.get(connection_id)
31print(f"Connected account: {connected_account}")

Tools

Executing tools

To prototype you can execute some tools to see the responses and working on the Smtp2go toolkit’s playground

Python
1from composio import Composio
2from openai import OpenAI
3import json
4
5openai = OpenAI()
6composio = Composio()
7
8# User ID must be a valid UUID format
9user_id = "0000-0000-0000" # Replace with actual user UUID from your database
10
11tools = composio.tools.get(user_id=user_id, toolkits=["SMTP2GO"])
12
13print("[!] Tools:")
14print(json.dumps(tools))
15
16def invoke_llm(task = "What can you do?"):
17 completion = openai.chat.completions.create(
18 model="gpt-4o",
19 messages=[
20 {
21 "role": "user",
22 "content": task, # Your task here!
23 },
24 ],
25 tools=tools,
26 )
27
28 # Handle Result from tool call
29 result = composio.provider.handle_tool_calls(user_id=user_id, response=completion)
30 print(f"[!] Completion: {completion}")
31 print(f"[!] Tool call result: {result}")
32
33invoke_llm()

Tool List

Tool Name: Add Allowed Sender

Description

Tool to add a new allowed sender email address. use when you need to whitelist a sender before sending email. example: add "user@example.com" to allowed senders list.

Action Parameters

email_address
Required

Action Response

data
objectRequired
error
string
error_code
integerRequired
error_message
string
successful
booleanRequired

Tool Name: Remove Allowed Sender

Description

Tool to remove a sender email address from the allowed senders list. use when you need to revoke send permissions for a validated address.

Action Parameters

email_address
Required

Action Response

data
object
error
string
error_code
integer
error_message
string
successful
booleanRequired

Tool Name: Update Allowed Sender

Description

Tool to update details of an existing allowed sender. use after confirming the allowed sender id.

Action Parameters

allowed_sender_id
stringRequired
email_address
name
string
reply_prompt
boolean

Action Response

data
objectRequired
error
string
request_id
stringRequired
successful
booleanRequired

Tool Name: View Allowed Senders

Description

Tool to view the list of allowed senders configured in your account. use after setting up smtp2go authentication to retrieve your allowed-senders list. example: 'show me all verified allowed senders.'

Action Parameters

limit
integer
offset
integer
sender_email
string
verified
string

Action Response

data
arrayRequired
error
string
error_code
integerRequired
request_id
stringRequired
successful
booleanRequired
total
integerRequired

Tool Name: Add Sender Domain

Description

Tool to add a new sender domain for spf/dkim verification. use when you need to register a domain and optionally set tracking/return-path subdomains.

Action Parameters

auto_verify
boolean
domain
stringRequired
returnpath_subdomain
string
subaccount_id
string
tracking_subdomain
string

Action Response

data
objectRequired
error
string
request_id
stringRequired
successful
booleanRequired

Tool Name: Add IP Allow List

Description

Tool to add an ip address or cidr range to your account’s ip allow list. use when you need to whitelist specific sending sources by ip or cidr after confirming accuracy.

Action Parameters

ip
stringRequired
note
string

Action Response

data
objectRequired
error
string
error_code
integerRequired
error_message
string
successful
booleanRequired

Tool Name: Remove IP from Allow List

Description

Tool to remove an ip address from your account's ip allow list. use after identifying the ip you wish to revoke.

Action Parameters

ip_address
Required

Action Response

data
objectRequired
error
string
status
stringRequired
successful
booleanRequired

Tool Name: View IP Allow List

Description

Tool to view the list of ip addresses in your ip allow list. use after confirming your smtp2go api key is set.

Action Parameters

Action Response

data
arrayRequired
error
string
error_code
integer
successful
booleanRequired

Tool Name: View Received SMS

Description

Tool to retrieve received sms replies for your smtp2go account. use when you need to fetch incoming sms messages for analysis or display. pagination supported via limit and offset.

Action Parameters

limit
integerDefaults to 100
offset
integer

Action Response

data
arrayRequired
error
string
error_code
integerRequired
successful
booleanRequired
total
integerRequired

Tool Name: Get Email Bounces Stats

Description

Tool to retrieve email bounces statistics. use after sending emails to analyze bounce metrics over a time period.

Action Parameters

date_end
date_start
email
limit
integer
offset
integer
sort_direction
string
sort_field
string

Action Response

data
arrayRequired
error
string
error_code
string
error_message
string
success
booleanRequired
successful
booleanRequired
total
integerRequired

Tool Name: Email Cycle Statistics

Description

Tool to retrieve email cycle statistics. use when you need to analyze email delivery metrics over a specified date range.

Action Parameters

date_from
Required
date_to
Required
group_by
stringDefaults to day
grouping
string
limit
integer
offset
integer

Action Response

data
arrayRequired
error
string
successful
booleanRequired
total
integerRequired

Tool Name: Email History Statistics

Description

Tool to retrieve email history statistics. use when you need detailed delivery metrics within a date range.

Action Parameters

date_end
date_start
email
limit
integerDefaults to 50
offset
integer
sender
tag
string

Action Response

data
arrayRequired
error
string
request_id
stringRequired
successful
booleanRequired
total
integerRequired

Tool Name: Email Spam Statistics

Description

Tool to retrieve email spam report statistics. use when analyzing spam trends for sent emails.

Action Parameters

date_end
Required
date_start
Required
limit
integerDefaults to 100
offset
integer
recipient
sender
transaction_id
string

Action Response

data
arrayRequired
error
string
error_code
integer
error_message
string
successful
booleanRequired

Tool Name: Email Unsubscription Stats

Description

Tool to retrieve email unsubscribe statistics. use when you need unsubscribe data for your account over a date range.

Action Parameters

date_end
date_start
email_address
result_limit
integerDefaults to 1000
result_offset
integer

Action Response

data
arrayRequired
error
string
error_code
integerRequired
error_message
string
request_id
stringRequired
successful
booleanRequired

Tool Name: Subaccounts Usage

Description

Tool to retrieve usage statistics for subaccounts. use when you need to monitor per-subaccount email usage.

Action Parameters

subaccount_id
string

Action Response

data
objectRequired
error
string
request_id
stringRequired
successful
booleanRequired

Tool Name: Add to Suppression List

Description

Tool to add email addresses or domains to the suppression list. use when you need to block sending emails to specific recipients or entire domains after unsubscribes or bounces.

Action Parameters

description
string
email_address
stringRequired
type
stringDefaults to EMAIL

Action Response

data
objectRequired
error
string
failed
array
succeeded
booleanRequired
successful
booleanRequired

Tool Name: Remove suppression entry

Description

Tool to remove an email address or domain from the suppression list. use when you want to resume sending to the address or domain.

Action Parameters

domain
email
subaccount_id
string

Action Response

data
objectRequired
error
string
request_id
stringRequired
successful
booleanRequired

Tool Name: View Suppression List

Description

Tool to view the suppression list. use when you need to inspect suppressed email addresses in your account.

Action Parameters

email_address
end_date
limit
integerDefaults to 100
offset
integer
start_date
suppression_type
string

Action Response

data
arrayRequired
error
string
status
stringRequired
successful
booleanRequired
total
integerRequired

Tool Name: Edit Email Template

Description

Tool to edit details of an existing email template. use when you need to update template properties after confirming its id.

Action Parameters

editor_code
string
html_body
string
is_archived
boolean
name
string
subject
string
template_id
stringRequired
text_body
string

Action Response

data
objectRequired
error
string
error_code
string
successful
booleanRequired

Tool Name: View Email Template

Description

Tool to view details of a specific email template. use after you have the template id to inspect.

Action Parameters

template_id
stringRequired

Action Response

data
objectRequired
error
string
error_code
string
request_id
stringRequired
successful
booleanRequired

Tool Name: Add SMTP User

Description

Tool to add a new smtp user. use when you need to provision a fresh smtp credential after collecting username and password.

Action Parameters

user_data
objectRequired

Action Response

data
objectRequired
error
string
request_id
stringRequired
successful
booleanRequired

Tool Name: Edit SMTP User

Description

Tool to edit details of an existing smtp user. use when you need to update username, password, sender restrictions, or enable/disable a user after confirming the target username.

Action Parameters

allow_senders
array
allowed_ips
array
disable_senders
boolean
disabled
boolean
new_username
string
password
string
reset_stats
boolean
sender_domain
string
username
stringRequired

Action Response

data
objectRequired
error
string
error_code
integerRequired
error_message
string
successful
booleanRequired

Tool Name: Remove SMTP User

Description

Tool to remove an smtp user from your account. use when you need to revoke smtp access for a user.

Action Parameters

username
stringRequired

Action Response

data
objectRequired
error
string
request_id
stringRequired
successful
booleanRequired

Tool Name: View SMTP Users

Description

Tool to list all smtp users configured on your account. use when you need to retrieve smtp user configurations.

Action Parameters

Action Response

data
arrayRequired
error
string
error_code
integer
successful
booleanRequired

Tool Name: Add Webhook

Description

Tool to create a new webhook. use when you need real-time notifications of email or sms events.

Action Parameters

events
arrayRequired
name
string
webhook_url
Required

Action Response

data
objectRequired
error
string
error_code
integerRequired
error_message
string
successful
booleanRequired

Tool Name: Edit Webhook

Description

Tool to edit an existing webhook’s settings. use when you need to update a webhook's configuration after creation.

Action Parameters

authorization_header
string
email_events
array
email_headers
array
output_type
string
sms_events
array
url
users
array
webhook_id
stringRequired

Action Response

data
objectRequired
error
string
error_code
integerRequired
error_message
string
successful
booleanRequired

Tool Name: Remove webhook

Description

Tool to remove a webhook. use when you want to delete a webhook by its id from your smtp2go account.

Action Parameters

webhook_id
stringRequired

Action Response

data
objectRequired
error
string
error_code
integerRequired
error_message
stringRequired
successful
booleanRequired

Tool Name: View Webhooks

Description

Tool to view all webhooks configured in your account. use when you need to inspect existing webhook configurations after setup.

Action Parameters

subaccount_id
string

Action Response

data
arrayRequired
error
string
error_code
integerRequired
error_message
string
successful
booleanRequired