Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] using mutt in a bash script



Hi, 

I have this simple script:

------------------------------
#!/bin/bash

while read myline;
do
    cat invitation.txt |mutt -s "TEST please delete" -F ./mymuttrc $myline 
    echo "$myline sent!"
    sleep 2s
done < <(cat test.adr) 

exit 0
------------------------------

The idea is to have a list of recipients in a file "test.adr" one at a line and sent them all the same email. 
eg. 

$cat test.adr
"My friend <fr@example.com>"
"My enemy <en@example.com>"
"Your friend <yf@example.com>"
$

Unfortunately, this script doesn't work. The output is: 

$./domail.sh
No recipients were specified.
"My friend <fr@example.com>"
No recipients were specified.
"My enemy <en@example.com>"
No recipients were specified.
"Your friend <yf@example.com>"
$

I can't figure what is wrong. If I replace "$myline" in this line of script:

cat invitation.txt |mutt -s "TEST please delete" -F ./mymuttrc $myline

using this one:
cat invitation.txt |mutt -s "TEST please delete" -F ./mymuttrc "my name <my@example.com>"

than I get the mail through without problems. 

Any suggestions? 

Footnote: It might seem like I am learning how to spam. But the story is that I
have discovered recently, that our department secretary used to mail the same
mail to 1500 of our conference attendants BY HAND! 

Best regards
Michal 


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links