Linux - Send Email with Attachment from CLI

Install necessary packages

sudo apt-get install mutt postfix -y  

Send the Email

echo "This is the message body" | \
mutt -a "/path/to/file.to.attach" \
-s "subject of message" \
-- recipient@domain.com

References

Author

Programster

Stuart is a software developer with a passion for Linux and open source projects.

comments powered by Disqus