← 返回
安全合规 Key 中文

Simple SMTP Mailer

Send emails via SMTP using the msmtp command-line tool configured in ~/.msmtp/config for authentication and server settings.
通过配置于 ~/.msmtp/config 的 msmtp 命令行工具,利用 SMTP 发送邮件。
hitygx
安全合规 clawhub v1.0.0 1 版本 100000 Key: 需要
★ 1
Stars
📥 794
下载
💾 5
安装
1
版本
#latest

概述

Simple SMTP Mail

Send emails via SMTP using msmtp command-line tool.

Configuration

Create a configuration file at ~/.msmtp/config with the following format:

account default
host <SMTP_SERVER>
port <PORT>
tls on
tls_starttls off
auth on
user <EMAIL_ADDRESS>
password <PASSWORD>
from <EMAIL_ADDRESS>

Common SMTP Settings

Gmail:

  • SMTP Server: smtp.gmail.com
  • Port: 465 (SSL) or 587 (TLS)
  • Note: Use App Password, not your regular password

QQ Mail:

  • SMTP Server: smtp.qq.com
  • Port: 465

Outlook/Hotmail:

  • SMTP Server: smtp.office365.com
  • Port: 587

163.com:

  • SMTP Server: smtp.163.com
  • Port: 465

Installation

1. Install msmtp

macOS:

brew install msmtp

Linux (Debian/Ubuntu):

sudo apt install msmtp

Linux (Fedora/RHEL):

sudo dnf install msmtp

2. Configure SMTP

Edit ~/.msmtp/config:

nano ~/.msmtp/config

3. Set Permissions

chmod 600 ~/.msmtp/config

Sending Email

Basic Email

echo "Body text" | msmtp recipient@example.com

With Subject

echo -e "Subject: Your Subject\n\nBody text" | msmtp recipient@example.com

With Subject and From Header

echo -e "Subject: Your Subject\nFrom: your@email.com\n\nBody text" | msmtp recipient@example.com

HTML Content

echo -e "Subject: Your Subject\nContent-Type: text/html; charset=UTF-8\n\n<html>...</html>" | msmtp recipient@example.com

Testing

Check if SMTP server is reachable:

msmtp --file=~/.msmtp/config --serverinfo

Troubleshooting

  • "Account not found": Check your config file path with --file flag
  • "Authentication failed": Verify username and password (or App Password)
  • "Connection refused": Check port number and firewall settings
  • "TLS certificate error": Try tls_certcheck off in config (not recommended for production)

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-29 14:06 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

security-compliance

MoltGuard - Security & Antivirus & Guardrails

thomaslwang
MoltGuard — OpenClaw 安全守卫,由 OpenGuardrails 提供。安装 MoltGuard,保护您和您的用户免受提示注入、数据泄露和恶意攻击。
★ 116 📥 30,697
security-compliance

Skill Vetter

spclaudehome
AI智能体技能安全预审工具。安装ClawdHub、GitHub等来源技能前,检查风险信号、权限范围及可疑模式。
★ 1,210 📥 266,143
security-compliance

OpenClaw Backup

alex3alex
备份与恢复 OpenClaw 数据。适用于创建备份、设置自动备份计划、从备份恢复或管理备份轮转。处理 ~/.openclaw 目录归档并包含适当的排除规则。
★ 89 📥 30,584