Skip to content

Repository files navigation

📬 Smail – Simple Mail API

Smail is a lightweight HTTP API for sending emails using an SMTP server. It supports HTML bodies, CC/BCC, and is ready to use with Docker. Swagger documentation is included out of the box.

🚀 Features

  • Send emails with subject and body
  • Support for HTML email content
  • Multiple recipients (To, CC, BCC)
  • Swagger (OpenAPI) documentation
  • Dockerized for easy deployment

⚙️ Setup

  1. Create a .env file:
HTTP_PORT=8080

SMTP_HOST=smtp.gmail.com
SMTP_PORT=587
SMTP_FROM=example@gmail.com
SMTP_USERNAME=example@gmail.com
SMTP_PASSWORD=aaaabbbbccccdddd
  1. Pull the Docker image:
docker pull ghcr.io/cactusbros/smail:latest # or specific version like v0.2.2

Or manually Build the image:

git clone https://github.com/CactusBros/smail.git
cd smail
docker build -t smail .
  1. Run the container:
docker run -p 8080:8080 --env-file .env ghcr.io/cactusbros/smail:latest # or specific version like v0.2.2

Or using the manually built image:

docker run -p 8080:8080 --env-file .env smail

💡 Note: If your .env file is not in the current directory, provide the full path to it using the --env-file flag, like:

docker run -p 8080:8080 --env-file /path/to/.env smail

📘 API Documentation

After running the container, access the interactive API docs at: http://127.0.0.1:8080/swagger

📤 Example Usage

You can send a POST request to / using curl or tools like Postman:

curl -X POST http://localhost:8080/ \
  -F 'to=someone@example.com' \
  -F 'subject=Hello' \
  -F 'body=This is a test email' \
  -F 'is_html=false'

📝 Todo

  • Add email open tracking
  • Logging improvements
  • Authentication or API key protection

🧑‍💻 Authors

Built with ❤️ by CactusBros

About

Smaila is a lightweight HTTP API for sending emails using an SMTP server.

Topics

Resources

Stars

13 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages