Skip to main content

mail

Installation
sudo apt install mailutils        # [On Debian, Ubuntu and Mint]
sudo yum install mailx # [On RHEL/CentOS/Fedora and Rocky Linux/AlmaLinux]
sudo emerge -a mail-client/mailx # [On Gentoo Linux]
sudo pacman -S mailutils # [On Arch Linux]
sudo zypper install mailutils # [On OpenSUSE]
Sending a mail
echo "MAIL BODY" | mail -s 'MAIL SUBJECT' receiver@domain_name

# Enter DOT or Ctrl-d to exit the CLI
mail -s "Test mail" receiver@domain_name
Body with HTML

NOTE: Doesn't work with Notes mail client

echo "<b>HTML Message goes here</b>" | mail -s "$(echo -e "This is the subject\nContent-Type: text/html")" receiver@domain_name