在以下示例中,我可以使用逗号将相同的消息发送给 2 个收件人。但我不能使用逗号发送 2 个文件。
echo "Here is the file you requested" | mutt -s "attaching file" -a one.txt -- me@company.com,you@company.com
Run Code Online (Sandbox Code Playgroud)
如何在同一命令中发送 second.txt 文件?
echo "Here is the file you requested" | mutt -s "attaching file" -a one.txt -a two.txt -- me@company.com,you@company.com
Run Code Online (Sandbox Code Playgroud)
应该管用。不过,对于 10-20 个文件,还有很多工作要做。
小智 6
如 mutt 手册(版本 1.5.21)中所述。
-a file [...] 使用 MIME 将文件附加到您的邮件中。附加单个或多个文件时,必须使用“--”分隔文件名和收件人地址,例如
mutt -a image.jpg -- addr1
或者 mutt -a img.jpg *.png -- addr1 addr2
-a 选项必须放在命令行选项的末尾。
所以这没问题:
echo "Here is the file you requested" | mutt -s "attaching file" -a one.txt second.txt -- me@company.com,you@company.com
Run Code Online (Sandbox Code Playgroud)