A TypeScript MCP (Model Context Protocol) server for sending emails via SMTP.
Send an email via the configured SMTP server.
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
to |
string[] |
✅ | — | One or more recipient email addresses |
subject |
string |
✅ | — | Email subject line |
body |
string |
✅ | — | Email body (HTML or plain text) |
html |
boolean |
true |
Send body as HTML. Set false for plain text |
|
from |
string |
✅ | config default | Sender address override |
cc |
string[] |
— | Optional CC recipients | |
reply_to |
string |
— | Optional Reply-To address |
Sends a test email to the configured default sender address to verify SMTP connectivity. No parameters required.
Add an smtp block to ~/.openclaw/secrets.json:
{
"smtp": {
"host": "your-smtp-host",
"port": 587,
"user": "your-smtp-user",
"pass": "your-smtp-password",
"from": "sender@yourdomain.com"
}
}Environment variables take precedence over secrets.json:
| Variable | Description | Default |
|---|---|---|
SMTP_HOST |
SMTP server hostname | — |
SMTP_PORT |
SMTP server port | 587 |
SMTP_USER |
SMTP authentication username | — |
SMTP_PASSWORD |
SMTP authentication password | — |
EMAIL_FROM |
Mail sender address | — |
SMTP_SECURE |
Use TLS on connect (true/false) |
false |
SMTP_REJECT_UNAUTHORIZED |
Reject invalid TLS certs (false to disable) |
true |
SMTP_TIMEOUT |
Connection timeout in ms | 10000 |
npm install
npm run buildAdd to your MCP client config (e.g. ~/.cursor/mcp.json or Claude Desktop config):
{
"mcpServers": {
"mcp-mailer": {
"command": "node",
"args": ["/path/to/mcp-mailer/dist/index.js"]
}
}
}- No telemetry or outbound connections beyond the configured SMTP server
- No credentials are hardcoded — always read from
secrets.jsonor environment - Secrets file is never logged or exposed via MCP tool responses