views:

21

answers:

1

I'm looking to mail several pdf's that are located in a single directory via the mail command. Each email should only contain one PDF file as an attachment.

Can you please provide a template on how to send each PDF via mail, one by one? Ideally Bash or AppleScript

+2  A: 

you can use mutt or uuencode

recipient="[email protected]"
for file in *.pdf
do
    mutt -s "subject" -a "$file" $recipient < message.txt
    # uuencode "$file" "$file" | mail -s "subject" $recipient  #using uuencode
done
ghostdog74
@ghostdog74, I have nothing to try against, but the second example, the one commented, is simply uuencode enough?
Anders
yes. uuencode is enough.
ghostdog74
Ok, cool thanks.
Anders
uuencode works in OS X - Thanks!
kruczkowski