August 30, 2023

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

No affiliate links, no analytics, no tracking, no cookies. This work © 2016-2024 by yctct is licensed under CC BY-ND 4.0 .   about me   contact me   all entries & tags   FAQ   GPG public key

GPG fingerprint: 2E0F FB60 7FEF 11D0 FB45 4DDC E979 E52A 7036 7A88