Send emails through an Endpoint API
Go to file
2020-06-15 20:21:33 +02:00
media Add files via upload 2020-06-15 20:10:19 +02:00
resources/templates Delete public files 2020-06-13 10:51:35 +02:00
src/api2smtp Fixbug subject 2020-06-11 19:47:56 +02:00
.gitignore Fixbug 2020-06-11 17:38:47 +02:00
config.yaml Add domain cli 2020-06-11 19:39:38 +02:00
project.clj Fixbug subject 2020-06-11 19:47:56 +02:00
README.md Update README.md 2020-06-15 20:21:33 +02:00

Explication

Run

  1. Make sure you have Java installed.

Debian/Ubuntu

sudo apt install default-jre

Mac OS

brew install java
  1. Create a file config.yaml with the following content. You can also use config.yaml.example as a base config and change it to fit your needs.
# It can be a domain in case of using a proxy: example.com
domain: localhost
# It indicates which domain can use it. Debug true so there are no limitations.
domain-cli: localhost
# If it is active it will be accessible to any client
debug: true
port: 7404
#SMTP config
smtp-from: "no-reply@domain.com"
smtp-to: "my@domain.com"
smtp-subject: "Contact"
smtp-host: "smtp.domain.com"
smtp-user: ""
smtp-password: ""
smtp-port: 587
smtp-tls: true
  1. Download the latest version of Glosa (api2smtp-{version}-standalone.jar).

https://github.com/tanrax/api2smtp/releases

  1. Now you can execute api2smtp.
java -jar target/api2smtp-{version}-standalone.jar

Great 🎉. You already have your 🔥 own API send mails 🔥.

That's it, now you just have to test that it works properly.

curl -H "Content-type: application/json" -d '{
	"name": "Cid",
	"subject": "Awesome",
	"email": "cid@campeador.es",
	"message": "Attack!!"
}' 'localhost:7404/api/v1/email/'

Thanks to the power of logo Tadam Framework