aiskillstore/marketplace / skills/7sageer/email
Email operations skill for sending, fetching, and reading emails via IMAP/SMTP. Uses curl with OpenSSL/LibreSSL for reliable TLS compatibility with Tencent Enterprise Mail and other providers. Credentials are securely stored in macOS Keychain.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 8.4 KB |
| USER_MANUAL.md | markdown | 1.2 KB |
| references/accounts.yaml | config | 963 B |
| scripts/common.shexecutable | script | 2.1 KB |
| scripts/fetch-emails.shexecutable | script | 7.2 KB |
| scripts/read-email.shexecutable | script | 13.9 KB |
| scripts/search-mail.shexecutable | script | 381 B |
| scripts/send-email.shexecutable | script | 2.1 KB |
| skill-report.json | config | 180.1 KB |
scripts/send-email.sh
View on GitHub#!/bin/bash
# 发送邮件脚本
set -e
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/common.sh"
# 使用说明
usage() {
cat << EOF
使用方法: $0 [选项]
选项:
-a ACCOUNT 账户名称(默认:SUSTech)
-t TO 收件人邮箱地址(必需)
-s SUBJECT 邮件主题(必需)
-b BODY 邮件正文(必需)
-f FILE 从文件读取邮件正文
-c CC 抄送地址(可选)
-h 显示此帮助信息
示例:
$0 -t recipient@example.com -s "Test" -b "Hello World"
$0 -a SUSTech -t recipient@example.com -s "Test" -f message.txt
EOF
exit 1
}
# 解析参数
ACCOUNT="SUSTech"
TO=""
SUBJECT=""
BODY=""
BODY_FILE=""
CC=""
while getopts "a:t:s:b:f:c:h" opt; do
case $opt in
a) ACCOUNT="$OPTARG" ;;
t) TO="$OPTARG" ;;
s) SUBJECT="$OPTARG" ;;
b) BODY="$OPTARG" ;;
f) BODY_FILE="$OPTARG" ;;
c) CC="$OPTARG" ;;
h) usage ;;
*) usage ;;
esac
done
# 检查必需参数
if [ -z "$TO" ] || [ -z "$SUBJECT" ]; then
echo "错误:缺少必需参数" >&2
usage
fi
if [ -z "$BODY" ] && [ -z "$BODY_FILE" ]; then
echo "错误:必须提供邮件正文(-b 或 -f)" >&2
usage
fi
# 读取配置
echo "正在加载账户配置:$ACCOUNT"
get_smtp_config "$ACCOUNT" || exit 1
# 准备邮件内容
TEMP_FILE=$(mktemp)
trap "rm -f $TEMP_FILE" EXIT
cat > "$TEMP_FILE" << EOF
From: $SMTP_EMAIL
To: $TO
Subject: $SUBJECT
EOF
if [ -n "$CC" ]; then
echo "Cc: $CC" >> "$TEMP_FILE"
fi
echo "" >> "$TEMP_FILE"
if [ -n "$BODY_FILE" ]; then
cat "$BODY_FILE" >> "$TEMP_FILE"
else
echo "$BODY" >> "$TEMP_FILE"
fi
# 发送邮件
echo "正在发送邮件..."
echo " 从: $SMTP_EMAIL"
echo " 到: $TO"
echo " 主题: $SUBJECT"
curl --url "smtps://${SMTP_HOST}:${SMTP_PORT}" \
--ssl-reqd \
--mail-from "$SMTP_EMAIL" \
--mail-rcpt "$TO" \
--user "${SMTP_LOGIN}:${SMTP_PASSWORD}" \
--upload-file "$TEMP_FILE" \
--silent \
--show-error
if [ $? -eq 0 ]; then
echo "✓ 邮件发送成功"
else
echo "✗ 邮件发送失败" >&2
exit 1
fi
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 472k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |