|
@@ -0,0 +1,50 @@
|
|
|
|
|
+# Mail Server
|
|
|
|
|
+
|
|
|
|
|
+A Spring Boot email service that provides REST API endpoints for sending emails through Gmail SMTP.
|
|
|
|
|
+
|
|
|
|
|
+## Setup
|
|
|
|
|
+
|
|
|
|
|
+### Prerequisites
|
|
|
|
|
+- Java 25
|
|
|
|
|
+- Gmail account with app-specific password
|
|
|
|
|
+
|
|
|
|
|
+### Environment Variables
|
|
|
|
|
+```bash
|
|
|
|
|
[email protected]
|
|
|
|
|
+email_password=your-gmail-app-password
|
|
|
|
|
+auth.api=http://your-auth-service-url
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
|
|
+### Run
|
|
|
|
|
+```bash
|
|
|
|
|
+./gradlew bootRun
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
|
|
+## API
|
|
|
|
|
+
|
|
|
|
|
+### Send Email
|
|
|
|
|
+**POST** `/api/mail`
|
|
|
|
|
+
|
|
|
|
|
+Headers:
|
|
|
|
|
+```
|
|
|
|
|
+Authorization: Bearer <token>
|
|
|
|
|
+Content-Type: application/json
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
|
|
+Request:
|
|
|
|
|
+```json
|
|
|
|
|
+{
|
|
|
|
|
+ "to": "[email protected]",
|
|
|
|
|
+ "subject": "Subject",
|
|
|
|
|
+ "content": "Email content"
|
|
|
|
|
+}
|
|
|
|
|
+```
|
|
|
|
|
+
|
|
|
|
|
+Response: 201 Created
|
|
|
|
|
+
|
|
|
|
|
+## Docker
|
|
|
|
|
+
|
|
|
|
|
+```bash
|
|
|
|
|
+docker build -t mail-server .
|
|
|
|
|
+docker run -p 8080:8080 -e email_username=... -e email_password=... mail-server
|
|
|
|
|
+```
|