EmailJS
无需后端服务器,直接从客户端 JavaScript 发送邮件
- 认证方式
- API Key
- HTTPS
- Yes
- CORS
- Yes
- 分类
- 邮件
- 文档 / URL
- https://www.emailjs.com/docs/
简介
EmailJS 让你直接从浏览器发送邮件(无需后端)——连接邮件服务(Gmail、Outlook、自定义 SMTP)、创建模板、然后 POST 到他们的 API。认证是免费公钥加服务/模板 ID。
注(2026-08 实测):API 有响应(GET 不存在的路径返回 Express 风格 404)——发送用
POST /api/v1.0/email/send。
快速开始
通过 REST API 发送:
curl -X POST "https://api.emailjs.com/api/v1.0/email/send" \
-H "Content-Type: application/json" \
-d '{
"service_id": "YOUR_SERVICE_ID",
"template_id": "YOUR_TEMPLATE_ID",
"user_id": "YOUR_PUBLIC_KEY",
"template_params": { "to_name": "Alice", "message": "Hello!" }
}'
或用 JS SDK:
<script src="https://cdn.jsdelivr.net/npm/@emailjs/browser"></script>
<script>
emailjs.send('YOUR_SERVICE_ID', 'YOUR_TEMPLATE_ID', { message: 'Hi' }, 'YOUR_PUBLIC_KEY');
</script>
认证方式
- 在 emailjs.com 注册 → 添加邮件服务(Gmail/Outlook/SMTP)→ 创建模板。
- 公钥(
user_id)客户端使用是安全的——EmailJS 就是为此设计的。
速率限制与注意事项
- 免费层:200 封邮件/月(以当前文档为准);付费档可扩展。
- 邮件通过 EmailJS 服务器用你连接的服务凭据发出。
- 支持 Gmail、Outlook、Yahoo 和自定义 SMTP。
- 适合联系表单、密码重置模拟和静态站邮件——无需后端。
常见问题
EmailJS 免费吗? 免费层:200 封/月;更多需要付费。
暴露密钥安全吗? 是的——EmailJS 就是为客户端使用设计的,用公钥。
可以连接什么服务? Gmail、Outlook、Yahoo 和自定义 SMTP。
邮件 分类更多
| API | Auth | HTTPS | CORS | |
|---|---|---|---|---|
| AGPC Domain Check Check a domain's SPF, DKIM, DMARC and MX with a graded shareable report | No auth | Yes | Yes | ↗ |
| Atomic Mail Email for AI agents: programmatic inbox creation and send/receive over JMAP | API Key | Yes | Unknown | ↗ |
| Cloudmersive Validate Validate email addresses, phone numbers, VAT numbers and domain names | API Key | Yes | Yes | ↗ |
| Disify Validate and detect disposable and temporary email addresses | No auth | Yes | Yes | ↗ |
| DropMail GraphQL API for creating and managing ephemeral e-mail inboxes | No auth | Yes | Unknown | ↗ |