Sign inSign up

caarlos0/mailserver

By caarlos0

•Updated over 11 years ago

Image
1

981

caarlos0/mailserver repository overview

⁠mailserver

a simple microservice to deliver emails through sendgrid api

⁠Why?

  • Centralized config (just one place to periodically change the pwd - or in case of incidents)
  • Avoiding multiple ways of sending mail in multiple microservices
  • Docker'ized (if you want)

⁠Usage

⁠The "simple" way
⁠Building
$ go get github.com/sendgrid/sendgrid-go
$ go build
⁠Running
$ SG_API_USER=username SG_API_KEY=password ./mailserver
⁠With Docker
$ docker build -t mailserver .
$ docker run -d \
  -p 3000:3000 \
  -e SG_API_USER=user \
  -e SG_API_KEY=password \
  mailserver

⁠Testing (using cURL)

$ curl \
  -H "from: [email protected]" \
  -H "to: [email protected]" \
  -H "subject: Sending an email" \
  -d "<h1>some html</h1><p>or plain text</p>" \
  http://localhost:3000/send

Tag summary

Content type

Image

Digest

sha256:6e5987dcc…

Size

-

Last updated

over 11 years ago

docker pull caarlos0/mailserver