Sign inSign up

corentinaltepe/heirloom-mailx

By corentinaltepe

•Updated over 3 years ago

Heirloom-mailx in Alpine to easily send emails through your Gmail (or any other).

Image
6

500K+

corentinaltepe/heirloom-mailx repository overview

⁠Without HTML body

To send an email inside the container, run the following command (example for Gmail smtp, but would work with any other smtp server):

echo "This is the message body and contains the message" |
mailx -v -r "[email protected]⁠"
-s "This is the subject"
-S smtp=smtp://smtp.gmail.com:587
-S smtp-use-starttls
-S smtp-auth=login
-S smtp-auth-user="[email protected]⁠"
-S smtp-auth-password="YOUR_MAIL_PASSWORD"
-S ssl-verify=ignore
[email protected]⁠

⁠With HTML body

Important note: the hearders are not well formatted with this solution. As a result, Gmail, and maybe other smtp servers, refuse this type of email. Need to find another solution to send emails with HTML body.

mailx -s "$(echo -e "SUBJECT\nContent-Type: text/html")"
-v -r "[email protected]⁠"
-S smtp=smtp://smtp.gmail.com:587
-S smtp-use-starttls
-S smtp-auth=login
-S smtp-auth-user="[email protected]⁠"
-S smtp-auth-password="YOUR_MAIL_PASSWORD"
-S ssl-verify=ignore
[email protected]⁠
< body.html

Tag summary

Content type

Image

Digest

sha256:228621d15…

Size

6.7 MB

Last updated

over 3 years ago

docker pull corentinaltepe/heirloom-mailx