开发者

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
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜