Search code examples
muttneomutt

Open "new mail" dialog in mutt with attachment


Is it possible to open mutt via a commandline flag directly in the "new mail" dialog with a file already attached? I want to make myself a ranger-shortcut to open mutt and attach a file to a mail. Is that possible? Do you have any ideas how I could make that?


Solution

  • You can add one or more attachment files directly when calling mutt. For example:

    mutt [email protected] -a /tmp/file1.txt -a /tmp/file2.png -s "subject line"
    

    Unless a message body is fed into stdin (like cat message | mutt ...), the editor will open for typing in the message body.