Sending email through shell script

Paul Howarth paul at city-fan.org
Thu Jun 15 11:36:07 UTC 2006


Johannes Christian wrote:
>> mail email at email.com -s <subject> < mail_text.txt
>>
> but i am using qmail server with virtual domain, how can i set the
> sender to a specific address?

If you have the list of recipients in file recipients.txt (one per 
line), and the mail message (both headers and body, separated by a blank 
line) in mail.txt, you can do:

$ /usr/sbin/sendmail -f sender at example.com $(cat recipients.txt) < mail.txt

Paul.




More information about the fedora-list mailing list