Install
openclaw skills install email-agentSend email through SMTP providers such as 126, QQ, Sina, or Aliyun Mail using an SMTP authorization code or mailbox password. Use when the user wants Codex to scaffold SMTP mail sending, configure a `.env` file, or send a simple test email.
openclaw skills install email-agentUse this skill when the task is to send a simple email through SMTP with a mailbox account.
If the runtime environment does not support .env, use the following embedded configuration block.
The sending script can fall back to this block when the env file is missing.
# Provider preset: 126, qq, sina, aliyun, custom
EMAIL_PROVIDER=126
# If EMAIL_PROVIDER=custom, fill these yourself.
SMTP_HOST=smtp.126.com
SMTP_PORT=465
# true for SMTPS on port 465, false for STARTTLS on port 587.
SMTP_USE_SSL=true
# Usually the mailbox address.
SMTP_USERNAME=your_email_username
# 126 / QQ commonly use an SMTP authorization code here.
# Sina / Aliyun may use the mailbox password depending on account settings.
SMTP_PASSWORD=your_smtp_secret
FROM_EMAIL=your_email_username
FROM_NAME=your_name
# Seconds
SMTP_TIMEOUT=30
Use this skill when the user asks for any of the following:
.env for a mailbox account such as 126, qq, sina, or aliyunBuilt-in presets are available for:
126qqsinaaliyuncustomSee references/providers.md for preset host and authentication notes.
.env from the repo root. If it does not exist, fall back to the embedded config block in this file.126, qq, sina, or aliyun. If the provider is not listed, require SMTP_HOST and SMTP_PORT.scripts/send_email.py --dry-run first when validating configuration.scripts/send_email.py with runtime message arguments once the sender, recipient, and secret are confirmed.SMTP_USERNAME defaults to FROM_EMAIL when left empty.SMTP_USE_SSL=true means SMTPS, typically on port 465.SMTP_USE_SSL=false means SMTP with STARTTLS, typically on port 587.SMTP_PASSWORD is treated as the one secret field, whether the provider expects an authorization code or the mailbox password.SMTP_PASSWORD.SMTP_PASSWORD as either an SMTP authorization code or the mailbox password, depending on provider policy.FROM_EMAIL and TO_EMAIL are not placeholder values unless the user explicitly wants a dry run.FROM_EMAIL aligned with the authenticated mailbox unless the provider supports aliases.EMAIL_PROVIDERSMTP_PASSWORDFROM_EMAILSMTP_HOSTSMTP_PORTSMTP_USE_SSLSMTP_USERNAMEFROM_NAMESMTP_TIMEOUT.env ContractFor preset providers, the minimum practical configuration is:
EMAIL_PROVIDER=qq
SMTP_PASSWORD=your_smtp_secret
FROM_EMAIL=your_email@qq.com
For custom, also set:
SMTP_HOSTSMTP_PORTSMTP_USE_SSLValidate config without sending:
python scripts/send_email.py --to-email someone@example.com --email-subject "Test" --email-body "Hello" --dry-run
Send a real email:
python scripts/send_email.py --to-email someone@example.com --email-subject "Test" --email-body "Hello"
Use a different env file:
python scripts/send_email.py --env-file .tmp-send.env --to-email someone@example.com --email-subject "Test" --email-body "Hello"
FROM_EMAIL match the authenticated mailbox unless the provider explicitly supports aliases.SMTP_HOST, SMTP_PORT, and SMTP_USE_SSL explicitly in .env.someone@example.com through QQ SMTP."xxx@xxx.com 发一个主题为 xxx 内容为 xxx 的邮件。".env for 126 mailbox SMTP."scripts/send_email.py