Skip to navigation

How to use mutt to send individual e-mails to lots of people at once

So, you want to send an e-mail to a list of people, but you don’t want to put them all in the “To:” or the “Bcc:” field of a single mail. You want each person to get an individual e-mail, but with the same subject line and the same content. It’s easy using mutt.

  • Create a text file that contains all the recipients, one on each line. This can be the full e-mail address, or it can be the alias you have defined in your mutt aliases file (which is your mutt “addressbook”). For our example, we’ll call it recipients.txt
  • Create a text file with the text of your message. Let’s call it message.txt.
  • Create a bash shell script containing the following:
    while read line
    mutt $line -s 'Message subject'  < message.txt
    done < recipients.txt

    Where "Message subject" is whatever your message subject should be. Of course, you need to run your shell script from the directory in which the files "message.txt" and "recipients.txt" are stored. Otherwise, you need to substitute their names with the full path name, e.g. ~/message.txt.

  • Make your bash script executable and run it. Done. Your individual e-mails should show up in your mailfolder for sent mail (defined by set record=... in your ~/.muttrc.

Comments are closed.