0
我正在寻找一种方法来发送附加文件bash的HTML电子邮件。 我试过下面这一行,但它不能100%正常工作。下面的线发送的HTML电子邮件,但没有附加的文件:Bash:用附件发送HTML文件?
(cat body.html ; uuencode in-attachfile.txt out-attachfile.txt) | mail -s "$(echo -e "my subject\nContent-Type: text/html")" [email protected]
如果我删除Content-Type: text/html
以表明这是一个HTML电子邮件,则附件的工作原理:
(cat body.html ; uuencode in-attachfile.txt out-attachfile.txt) | mail -s "$(echo -e "my subject")" [email protected]
怎样才可以有都?
谢谢
我的'邮件'没有'-a'选项...我正在运行centOS。 – thedp
你可以使用sendmail吗?另外,我认为可以使用多部分MIME类型在HTML中嵌入文档。尝试查看原始文档,该文档包含您需要构建的所有功能并从此构建。祝你好运。 – shellter
@shellter您可以给我一个sendmail MIME的例子。谢谢。 – thedp