Blaze Mailer is simple implementation of SMTP Go package.
It provides an HTTP endpoint to send emails.
Plus boilerplate code to handle your credentials with env vars.
-
Clone repo
git clone [email protected]:nixmaldonado/blazeMailer.git
-
Configure 3 env vars
export SMTP_PASSWORD="YOUR_PASSWORD" export SMPT_HOST="SMPT_HOST" //eg: "smtp.gmail.com" export SMTP_PORT="SMTP_PORT" //eg: "587"
-
Run program from root folder
go run cmd/main.go
-
Perform HTTP request to send mail:
curl --request POST 'http://localhost:3000/email/send' \ --header 'Content-Type: application/json' \ --data-raw '{ "from": "[email protected]", "to": "[email protected]", "subject":"This is Blaze Mailer", "body": "Hello World!" }'