【问题标题】:How do I send email from linux terminal, with contents of multiple files as the mail-body?如何从 linux 终端发送电子邮件,以多个文件的内容作为邮件正文?
【发布时间】:2015-08-08 01:42:38
【问题描述】:

我知道我可以从我的 linux 终端使用以下命令发送电子邮件:

sendmail user@example.com < file1.text

此命令基本上会将file1.text 的内容作为邮件正文发送。 但是如何使用相同的命令在邮件正文中添加多个文件的内容?

我尝试了以下显然不起作用的方法:

sendmail user@example.com < file1.text,file2.text

【问题讨论】:

    标签: linux email


    【解决方案1】:

    使用cat 命令。 cat 是“连接”的缩写;它将连接命令行上给出的所有文件。然后将输出通过管道发送到 sendmail:

    cat file1.text file2.text | sendmail user@example.com
    

    【讨论】:

      猜你喜欢
      • 2015-05-10
      • 2017-01-16
      • 2014-09-20
      • 2018-08-06
      • 1970-01-01
      • 2016-01-04
      • 1970-01-01
      • 2015-06-19
      相关资源
      最近更新 更多