0

我有以下脚本,但它发送的电子邮件没有任何附件。怎么了?

sendmail /A "/home/dd/data/list.txt" "dd@gmail.com" -t << EOF
To:dd@gmail.com
Subject:List of ids
This is the message
 [new line]

其他一切都按预期工作。谢谢。

4

2 回答 2

0

Try the script below:

#!/bin/sh
# send/include list.txt file after "here document" (email headers + start of email body)
cat - "/home/dd/data/list.txt" | /usr/sbin/sendmail -i -- "dd@gmail.com" <<END
To: dd@gmail.com
Subject: List of ids

This is the message
END
于 2013-11-14T22:02:40.867 回答
0

此处的文档未完成。

sendmail /A "/home/dd/data/list.txt" "dd@gmail.com" -t << -EOF
To:dd@gmail.com
Subject:List of ids
This is the message
EOF

尝试 -EOF 所以尾随 EOF 不需要在最左边的列中。

试试这个,我刚刚测试过:

/usr/sbin/sendmail -tv me@myplace.com <<%%
Subject: test of sendmail
This is the note
$(uuencode attachment.file newname.txt)
%%

我没有时间回到这个话题。电子邮件地址在第 1 行

于 2013-11-14T21:14:36.387 回答