Go-based REST API service for sending emails through Gmail's SMTP server. It provides a simple HTTP endpoint to queue and send emails to one or multiple recipients.
Sends an email asynchronously.
Request Body:
{
"to": "[email protected]",
"from": "[email protected]",
"subject": "Email Subject",
"body": "<h1>HTML Email Body</h1>"
}Response:
{
"message": "OK",
"status": "continue"
}Notes:
- Multiple recipients are supported by comma-separating email addresses in the
tofield - Emails are sent asynchronously using goroutines
- The endpoint returns immediately regardless of send status
Health check endpoint that returns a simple "ok" status.
HTTP_PORT- HTTP server port (default:8080)
Configured in configure.go:
- Server: smtp.gmail.com
- Port: 587
- Credentials: Email and password (currently hardcoded as "email" and "secret")
The project includes a Dockerfile for containerized deployment using Go 1.18. Yet, as this project is from many years ago you might find some compatibility issues be adviced.