On Wed, May 12, 2010 at 11:50:20AM +0800, Qi Zhang wrote:
> Yes, because the attachments are generated by scripts then put into
> different folders.
> Each receiver has different amount of attachments.

If I understand correctly, this is trivial to do with mutt in a
script, unless your attachment filenames can contain shell special
characters or whitespace.  The shell deals badly with that,
unfortunately.  Otherwise, if your attachment directory is in $dir,
then something like this should do what you need:

cd $dir
attachments=`echo *`
# DO NOT quote $attachments, so each is treated as a separate arg
mutt -s "$subject" -i "$message_file" -a $attachments -- "$recipient"

-- 
Derek D. Martin    http://www.pizzashack.org/   GPG Key ID: 0xDFBEAD02
-=-=-=-=-
This message is posted from an invalid address.  Replying to it will result in
undeliverable mail due to spam prevention.  Sorry for the inconvenience.

Attachment: pgp5xGzdK7u3l.pgp
Description: PGP signature

Reply via email to