Send email
Send emails from your VM
Your VM can send plain-text emails.
## Request
```bash
curl -X POST http://169.254.169.254/gateway/email/send \
-H "Content-Type: application/json" \
-d '{
"to": "odysseus@example.com",
"subject": "Build Complete",
"body": "Your build finished successfully!"
}'
```
Required fields: `to`, `subject`, `body`
Optional fields: `reply_to`, `in_reply_to`, `references`, `attachments`
Sending is rate-limited.
## Attachments
Pass an `attachments` array. Each entry needs a `filename` and
base64-encoded `content`; `content_type` is optional.
```bash
curl -X POST http://169.254.169.254/gateway/email/send \
-H "Content-Type: application/json" \
-d '{
"to": "odysseus@example.com",
"subject": "Report",
"body": "Latest numbers attached.",
"attachments": [
{
"filename": "report.csv",
"content": "'"$(base64 -w0 report.csv)"'"
}
]
}'
```
Attachment count and size are limited.
## Allowed recipients
To prevent spam, `to` must be one of:
- you
- a member of your exe.dev team
- someone that has logged into your private-but-shared VM using exe.dev auth
## Response
```json
{"success": true}
```
or
```json
{"error": "error message"}
```