Send an email from the command line with Mutt
$ mutt -s subject -b address_to_bcc -c address_to_cc -a file_to_attach -- recipient_address < message.txt
where message.txt is a text file with a message written in plain text.
Behaviours I notice:
The shell might print this message: “Fcc to an IMAP mailbox is not supported in batch mode” after you’ve ran the command. Despite this warning, I note that the message have been sent successfully. I looked through Mutt’s manual and suppose that “batch mode” means “sent from the command line” and that fcc
has to do with saving outgoing message to a specific folder, but I am not sure. I notice that when the shell outputs this message, emails sent are not saved to Sent
.
If the command is ran without < message.txt
, the shell will open the text editor and I can type a message.
Source: $ man mutt
personal computing command-line interface (cli) gnu linux trisquel shell literacy office applications wiki mutt