【发布时间】:2014-02-09 10:56:35
【问题描述】:
是否可以使用uuencode 和sendmail 发送多个附件?
在脚本中,我有一个变量,其中包含需要附加到单个电子邮件的文件,例如:
$attachments=attachment_1.pdf attachment_2.pdf attachment_3.pdf attachment_4.pdf
还有一个$template 变量,例如:
$template="Subject: This is the subject
From: no-reply@domain.com
To: %s
Content-Type: text/plain
This is the body.
"
我想出了:
printf "$template" "$recipient" |
sendmail -oi -t
我必须在其中的某个地方附加 $attachments 变量中的所有内容?
【问题讨论】:
-
mailx 是一个选项吗?如果是这样,您可以简单地使用
-a开关发送多封电子邮件。你有使用 vanilla sendmail 吗? -
查看stackoverflow.com/questions/19940292/…上的答案,它将让您了解如何通过uuencode解析包含附件的变量。
标签: bash email sendmail uuencode