Welcome to the golangsmtp API documentation.
Sends an email to the configured portfolio owner's email address.
All requests must include an API key in the headers. To request an API key, please email misbakhul2904@gmail.com.
| Header | Description |
|---|---|
X-API-Key | Your secret API key (required) |
The request body must be JSON and include the following fields:
| Field | Type | Description |
|---|---|---|
sender_email | string | Valid email address of the sender |
subject | string | Email subject (cannot be empty) |
message | string | Email body content (cannot be empty) |
curl -X POST https://smtp.misbakhul.my.id/api/send-email \
-H "Content-Type: application/json" \
-H "X-API-Key: your_api_key_here" \
-d '{
"sender_email": "test@example.com",
"subject": "Hello",
"message": "I want to work with you"
}'
| Status | Description | Body |
|---|---|---|
200 OK | Email sent successfully | {"message": "Email sent successfully"} |
400 Bad Request | Validation failed | {"error": "sender_email is not a valid email address"} |
401 Unauthorized | Missing API key | {"error": "missing X-API-Key header"} |
403 Forbidden | Invalid API key | {"error": "invalid API key"} |
429 Too Many Requests | Rate limit exceeded (5 req/min) | {"error": "too many requests, please slow down"} |
500 Internal Server Error | SMTP/Server error | {"error": "failed to send email, please try again later"} |
Basic health check endpoint to verify the service is running.
curl https://smtp.misbakhul.my.id/health
{"status":"ok"}