开发者

Script to mail multiple files as independant email attachments

开发者 https://www.devze.com 2023-01-09 01:20 出处:网络
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.

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
0

精彩评论

暂无评论...
验证码 换一张
取 消