Script to mail multiple files as independant email attachments
I'm looking to mail several pdf's that are located in a开发者_Go百科 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
you can use mutt or uuencode
recipient="user@somewhere.com"
for file in *.pdf
do
mutt -s "subject" -a "$file" $recipient < message.txt
# uuencode "$file" "$file" | mail -s "subject" $recipient #using uuencode
done
精彩评论