【发布时间】:2012-05-07 09:01:13
【问题描述】:
我正在寻找一种从 bash 发送带有附件的 HTML 电子邮件的方法。 我已经尝试了以下行,但它不能 100% 工作。以下行发送了一封 HTML 电子邮件,但没有附件:
( cat body.html ; uuencode in-attachfile.txt out-attachfile.txt ) | mail -s "$(echo -e "my subject\nContent-Type: text/html")" foo@example.com
如果我删除 Content-Type: text/html 以表明这是一封 HTML 电子邮件,则附件有效:
( cat body.html ; uuencode in-attachfile.txt out-attachfile.txt ) | mail -s "$(echo -e "my subject")" foo@example.com
我怎样才能两者兼得?
谢谢
【问题讨论】:
标签: html linux bash email attachment