LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   bash script to send mail (https://www.linuxquestions.org/questions/programming-9/bash-script-to-send-mail-154162/)

Cruger 03-06-2004 08:19 AM

bash script to send mail
 
Hi I'm trying to send the same letter to several users in the same maibox..
Is there a way I can write a script that makes the letter to close istself (and I don't have to add message and press Cnrl-D) ?

script so far:

mail -s Welcome user@mailbox

fsbooks 03-06-2004 08:25 AM

Assuming user.list contains the list of users and letter is the letter.

#!/bin/bash
cat user.list|while read user
do
cat letter|mail -s "subject" $user
done
exit


All times are GMT -5. The time now is 12:07 PM.