I have to send a mail with an attachment from a shell script. I am trying to do it using mutt as shown here: How do I send a file as an email attachment using Linux command line?
Command:
echo "This is the message body" | mutt -a "/path/to/file.to.attach" -s "subject of message" -- [email protected]
Error:
Error sending message, child exited 127 (Exec error.).
Could not send the message.
I was having the same issue on Ubuntu 18.04 and just like @jono, I only had installed mutt
. Installing
sudo apt-get install sendmail
After that, sending mail with the test method or straight through the mutt CLI worked perfectly.