mutt: Error sending message, child exited 127 (Exec error.)

Aditya picture Aditya · Apr 15, 2016 · Viewed 14.1k times · Source

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.

Answer

Valentin M picture Valentin M · Feb 21, 2019

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.