如何使用 postfix 发送内容?

Vit*_*bei 1 server email mail command-line postfix

我需要能够同时通过电子邮件发送两个文件的内容。我现在可以将它作为两封单独的电子邮件发送。

我能够通过这样的一封邮件发送一个文件的内容:

mail -s "numeric data" eg@example.com < /home/num1.txt
Run Code Online (Sandbox Code Playgroud)

如何同时发送 2 个文件的内容?

如果我像这样使用它:

mail -s "numeric data" eg@example.com < /home/num1.txt /home/num2.txt
Run Code Online (Sandbox Code Playgroud)

它将只发送第一个内容并编辑第二个文件。

Oli*_*Oli 5

有许多不同的方法可以将两个文件组合成一个输入流,但我个人更愿意将它们作为两个单独的文件附加

mail -s "numeric data" destination@example.com -A ~/num1.txt -A ~/num2.txt
Run Code Online (Sandbox Code Playgroud)