diff --git a/main.go b/main.go index 20d6631..365c5eb 100644 --- a/main.go +++ b/main.go @@ -1,359 +1,360 @@ -package main - -import ( - "encoding/json" - "fmt" - "html" - "log" - "net/http" - "strconv" - "strings" - - "gopkg.in/gomail.v2" -) - -// Copyable snippets used by /docs and dedicated snippet endpoints -const docsHTMLSnippet = ` -
Server: http://localhost:8080
Tělo JSON: { domain?, name, email, subject, message }
Volitelné SMTP v query: ?email=&pass=&server=&port=
curl -X POST http://localhost:8080/send \
- -H "Content-Type: application/json" \
- -d '{
- "domain":"sportcreative.eu",
- "name":"Jan Novák",
- "email":"jan@example.com",
- "subject":"Dotaz",
- "message":"Dobrý den..."
- }'
-
- curl -X POST "http://localhost:8080/send?email=USER@example.com&pass=SECRET&server=smtp.example.com&port=465" \
- -H "Content-Type: application/json" \
- -d '{
- "name":"Jan Novák",
- "email":"jan@example.com",
- "subject":"Dotaz",
- "message":"Dobrý den..."
- }'
-
- Query: ?email=&pass=&server=&port=&to=&from=&subject=&message= (když chybí to/from, použije se email).
curl "http://localhost:8080/send-params?email=USER@example.com&pass=SECRET&server=smtp.example.com&port=465&to=dest@example.com&from=USER@example.com&subject=Hello&message=Ahoj"
- %s
- %s
- Server: http://localhost:8080
Tělo JSON: { domain?, name, email, subject, message }
Volitelné SMTP v query: ?email=&pass=&server=&port=
curl -X POST http://localhost:8080/send \
+ -H "Content-Type: application/json" \
+ -d '{
+ "domain":"sportcreative.eu",
+ "name":"Jan Novák",
+ "email":"jan@example.com",
+ "subject":"Dotaz",
+ "message":"Dobrý den..."
+ }'
+
+ curl -X POST "http://localhost:8080/send?email=USER@example.com&pass=SECRET&server=smtp.example.com&port=465" \
+ -H "Content-Type: application/json" \
+ -d '{
+ "name":"Jan Novák",
+ "email":"jan@example.com",
+ "subject":"Dotaz",
+ "message":"Dobrý den..."
+ }'
+
+ Query: ?email=&pass=&server=&port=&to=&from=&subject=&message= (když chybí to/from, použije se email).
curl "http://localhost:8080/send-params?email=USER@example.com&pass=SECRET&server=smtp.example.com&port=465&to=dest@example.com&from=USER@example.com&subject=Hello&message=Ahoj"
+ %s
+ %s
+