# SMTP API Service

A complete email service solution that allows developers to send emails via REST API using their own SMTP credentials.

**Live Demo**: https://easy-orders.co.uk

![SMTP API Service](preview.png)

## 🌟 Features

- **🔐 User Authentication** - Secure JWT-based authentication
- **🔑 API Key Management** - Generate and manage multiple API keys
- **📧 SMTP Configuration** - Configure multiple SMTP servers (Gmail, Outlook, etc.)
- **📨 Email Sending** - Send emails via REST API or web interface
- **📊 Dashboard** - Track email usage and statistics
- **📚 API Documentation** - Built-in API docs with code examples
- **🎨 Modern UI** - Clean and responsive interface

## 🚀 Quick Start

### Prerequisites

- Python 3.8+
- Nginx (for production)

### Installation

```bash
# Clone the repository
git clone https://github.com/yourusername/smtp-api-service.git
cd smtp-api-service

# Run the installer
chmod +x install-easy-orders.sh
sudo ./install-easy-orders.sh
```

The service will be available at: **https://easy-orders.co.uk**

## 📖 Usage

### 1. Create an Account

1. Open https://easy-orders.co.uk
2. Click "Sign up" and create your account
3. Log in to access the dashboard

### 2. Configure SMTP Settings

1. Go to "SMTP Configs" in the navigation
2. Click "Add SMTP Config"
3. Enter your SMTP server details

### 3. Generate API Key

1. Go to "API Keys"
2. Click "Create New Key"
3. Copy your API key

### 4. Send Emails via API

```bash
curl -X POST https://easy-orders.co.uk/api/v1/public/send-email \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your_api_key_here" \
  -d '{
    "to_email": "recipient@example.com",
    "subject": "Hello",
    "body": "This is a test email"
  }'
```

## 🔌 API Endpoints

| Endpoint | Method | Description |
|----------|--------|-------------|
| `/api/v1/auth/register` | POST | Register new user |
| `/api/v1/auth/login` | POST | Login |
| `/api/v1/api-keys` | GET/POST | Manage API keys |
| `/api/v1/smtp-configs` | GET/POST | Manage SMTP configs |
| `/api/v1/emails/send` | POST | Send email |
| `/api/v1/public/send-email` | POST | Public API endpoint |

Full API documentation: https://easy-orders.co.uk/docs

## 🛠️ Tech Stack

### Backend
- **FastAPI** - Python web framework
- **SQLAlchemy** - ORM
- **SQLite** - Database
- **JWT** - Authentication

### Frontend
- **HTML5/CSS3/JavaScript**
- **Tailwind CSS** - Styling

## 🔒 Security

- Always use HTTPS in production
- Store API keys securely
- Use App Passwords for Gmail
- Regularly rotate API keys

## 📄 License

MIT License

---

**Domain**: https://easy-orders.co.uk
