qq-email
Original:🇨🇳 Chinese
Translated
3 scripts
IMAP email receiving and SMTP email sending for QQ Mail; the account and authorization code are read from environment variables QQ_EMAIL_ACCOUNT and QQ_EMAIL_AUTH_CODE. Use this when users need to send, receive, check, forward QQ emails or configure QQ Mail.
3installs
Sourceshadowcz007/skills
Added on
NPX Install
npx skill4agent add shadowcz007/skills qq-emailTags
Translated version includes tags in frontmatterSKILL.md Content (Chinese)
View Translation Comparison →When to Use
Use this skill when users need to send, receive, check, forward emails via QQ Mail or configure QQ Mail.
QQ Mail Sending and Receiving
For QQ Mail: Receive emails via IMAP and send emails via SMTP. The account and authorization code are only read from environment variables and not hard-coded in code or configurations.
Credentials (Environment Variables)
| Variable | Description |
|---|---|
| QQ_EMAIL_ACCOUNT | QQ Mail account (full address, e.g., xxx@qq.com) |
| QQ_EMAIL_AUTH_CODE | QQ Mail authorization code (generated after enabling IMAP/SMTP in QQ Mail's "Settings → Accounts"; not the QQ login password; do not commit to repositories) |
The script will perform validation and exit with an error if any credential is missing; do not use commands like in the terminal to check them to avoid leaking the authorization code.
echoQQ Mail Servers
- IMAP: , port 993 (SSL)
imap.qq.com - SMTP: , port 465 (SSL)
smtp.qq.com
Scripts
| Script | Function |
|---|---|
| Reads credentials from environment variables, uses nodemailer to connect to QQ Mail SMTP to send emails; supports recipient, subject, and body (CLI parameters). |
| Reads credentials from environment variables, uses imap + mailparser to connect to QQ Mail IMAP to receive emails; supports "latest N messages" or "latest N days", outputs subject, sender, date, UID, and body summary. |
| Retrieves the full body of a specified email (plain text, no summary truncation) by UID. Must pass the |
Sending Emails
Execute in the skill root directory (after running ):
npm installbash
node scripts/send.js <recipient> <subject> <body>If the body contains spaces, wrap it in quotes; or only pass the recipient and subject, and read the body from stdin (see the script's option).
--stdinExample:
bash
node scripts/send.js "recipient@example.com" "Test Subject" "Email body content"Receiving Emails
bash
# Receive the latest 10 messages (default)
node scripts/receive.js
# Receive the latest N messages
node scripts/receive.js --limit 20
# Receive emails from the latest N days (e.g., 7, 30, 90)
node scripts/receive.js --days 7Output: For each email, displays subject, sender, date, UID (unique identifier in the inbox, used to retrieve the body by UID), and body summary (first ~200 characters) for easy viewing.
Retrieving Email Body
To get the full body of an email, use and pass the UID of the email from the received list:
get-body.jsbash
node scripts/get-body.js --uid 12345The script will prompt and exit if is not provided. UID is bound to the inbox and may become invalid if the email is moved or deleted.
--uid- Output: The full body is output to stdout (plain text; if the original email only has HTML, it will be output after simple tag removal). It can be redirected to a file or piped to other commands.
- Environment Variables: Same as receiving emails, requires and
QQ_EMAIL_ACCOUNT.QQ_EMAIL_AUTH_CODE
Optional Capabilities (Corresponding to "Receiving Options")
- Receiving Time Range: Use the IMAP SINCE condition via /
--days 7/--days 30.--days 90 - Receiving from "My Folders": The current script defaults to INBOX; to customize the folder, extend the function in the script (e.g.,
openBox).openBox('My Folder', ...)
Security Reminders
- The QQ Mail authorization code must be generated after enabling the IMAP/SMTP service in "Settings → Accounts"; it is different from the QQ login password, so do not confuse them.
- Do not write the actual values of and
QQ_EMAIL_ACCOUNTinto code or commit them to repositories; only configure them via environment variables or localQQ_EMAIL_AUTH_CODEfiles..env