Sendgrid
基于云的 SMTP 服务提供商,无需维护邮件服务器即可发送电子邮件
- 认证方式
- API Key
- HTTPS
- Yes
- CORS
- Unknown
- 分类
- 邮件
简介
SendGrid(Twilio SendGrid)v3 API 发送事务性和营销邮件,管理已验证发件人、模板和分析。认证是简单的 API 密钥(实测:无密钥请求返回 401)。免费层覆盖个人项目的轻量发送。
快速开始
发送邮件(替换 YOUR_KEY):
curl -X POST "https://api.sendgrid.com/v3/mail/send" \
-H "Authorization: Bearer YOUR_KEY" \
-H "Content-Type: application/json" \
-d '{
"personalizations": [{"to": [{"email": "recipient@example.com"}]}],
"from": {"email": "sender@example.com"},
"subject": "Hello",
"content": [{"type": "text/plain", "value": "Hello from SendGrid!"}]
}'
统计:
curl "https://api.sendgrid.com/v3/stats" -H "Authorization: Bearer YOUR_KEY"
已验证发件人 / 模板:
curl "https://api.sendgrid.com/v3/verified_senders" -H "Authorization: Bearer YOUR_KEY"
curl "https://api.sendgrid.com/v3/templates" -H "Authorization: Bearer YOUR_KEY"
认证方式
- 在 app.sendgrid.com(Settings → API Keys)创建带 scope 的 API 密钥(如
mail.send)。 - 通过
Authorization: Bearer YOUR_KEY发送(无效密钥返回 401——已实测)。 - 发送前需要已验证发件人(域名或单个发件人)。
速率限制与注意事项
- 免费层:100 封邮件/天;付费档可扩展。
mail/send端点是主力——支持附件、模板和动态字段。- 所有请求走
api.sendgrid.com/v3/;错误以 JSON 返回并带消息。 - 接收邮件可考虑 Inbound Parse webhook(需单独配置)。
常见问题
SendGrid 免费吗? 免费层:100 封/天;付费档可扩展。
如何获取密钥? app.sendgrid.com → Settings → API Keys → Create。
需要已验证发件人吗? 是的——发送前需验证域名或单个发件人。
邮件 分类更多
| 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 | ↗ |