【发布时间】:2015-02-26 18:44:49
【问题描述】:
我正在尝试在 unix 中使用 sendmail 功能,但似乎无法让附件通过...我的代码如下:
export MAILTO="me@myco.com"
export SUBJECT="test mail"
export ATTACH="/home/tstattach"
(
echo "To: $MAILTO"
echo "Subject: $SUBJECT"
echo "MIME-Version: 1.0"
echo 'Content-Type: multipart/mixed; boundary="-q1w2e3r4t5"'
echo "this is a test message"
base64 $ATTACH
) | sendmail $MAILTO
我的电子邮件是这样通过的,没有附件:
this is a test message
dGVzdCBhdHRhY2htZW50
---q1w2e3r4t5--
如何让附件通过?似乎它以一种奇怪的方式对其进行编码...我也尝试过 uuencode 而不是 base64,但后来我收到一个错误,提示找不到 uuencode...
【问题讨论】: