我正在使用bash脚本。我想用sendmail发送一封电子邮件,使用一个文件作为正文,并添加另一个文件作为附件。我该怎么做呢?我已经想通了如何发送的第一个文件作为电子邮件的身体......如何使用sendmail将文件作为附件发送到bash脚本中?
#Send the email
cat - $TFILE1 <<END | /usr/sbin/sendmail -- $to_email
Subject: $subject
To: $to_email
END
,但我想不出我将如何调整上述对包括第二文件(说其存储在$ TFILE2 ),作为附件?
'本身sendmail'没有任何附加选项。尝试下面列出的其中一个替代方法:https://unix.stackexchange.com/questions/223636/sendmail-attachment – Munir
我惊呆了......用sendmail发送附件是不可能的? – Dave
'sendmail'不是一个真正的电子邮件客户端,它是一个路由服务。请参阅http://www.computerhope.com/unix/usendmai.htm – Munir