Sign inSign up

tiogt/sh-mail

By tiogt

Updated over 8 years ago

One container to easy configure a smtp server and to send email with just one command

Image
0

343

tiogt/sh-mail repository overview

     _______. __    __         .___  ___.      ___       __   __
    /       ||  |  |  |        |   \/   |     /   \     |  | |  |
   |   (----`|  |__|  |  ______|  \  /  |    /  ^  \    |  | |  |
    \   \    |   __   | |______|  |\/|  |   /  /_\  \   |  | |  |
.----)   |   |  |  |  |        |  |  |  |  /  _____  \  |  | |  `----.
|_______/    |__|  |__|        |__|  |__| /__/     \__\ |__| |_______|

This image is based on alpine:3.7 and have install the ssmtp software.

Environment variables

  • SMTP_DOMAIN
  • SMTP_URL
  • SMTP_USER
  • SMTP_PASS
  • SMTP_TLS
  • SMTP_STARTTLS
  • MAIL_TO
  • MAIL_FROM
  • MAIL_SUBJECT
  • MAIL_CONTENT
  • MAIL_TEMPLATE

How use this image

We can use this image in two ways, the first one is the interactive mode or the second one is the single mode for execute just one time this container.

Interactive Mail
docker run \
    -e SMTP_DOMAIN=[gmail.com|zoho.com] \
    -e SMTP_URL=[smtp.gmail.com|smtp.zoho.com]:587 \
    -e [email protected] \
    -e SMTP_PASS=password \
    --name sh-mail \
    -d sh-mail:latest
docker exec \
    -e [email protected] \
    -e MAIL_SUBJECT=HELLO \
    sh-mail mail
docker exec \
    -e [email protected] \
    -e MAIL_SUBJECT=HELLO \
    -e MAIL_CONTENT=TESTING \
    sh-mail mail
Single Mail
docker run --rm \
    -e SMTP_DOMAIN=[gmail.com|zoho.com] \
    -e SMTP_URL=[smtp.gmail.com|smtp.zoho.com]:587 \
    -e [email protected] \
    -e SMTP_PASS=password \
    -e [email protected] \
    -e MAIL_SUBJECT=HELLO \
    -e MAIL_CONTENT=TESTING \
    sh-mail:latest send
Send HTML template
docker run --rm \
    -v /home/user/templates-html:/sh-mail/html \
    -e SMTP_DOMAIN=[gmail.com|zoho.com] \
    -e SMTP_URL=[smtp.gmail.com|smtp.zoho.com]:587 \
    -e [email protected] \
    -e SMTP_PASS=password \
    -e [email protected] \
    -e MAIL_SUBJECT=HOLA \
    -e MAIL_TEMPLATE=test.html \
    sh-mail:latest send

Tag summary

Content type

Image

Digest

Size

2 MB

Last updated

over 8 years ago

docker pull tiogt/sh-mail