[英]What is the shell command to send attachment with body?
根據下面的代碼,我正在通過郵件發送附件,但是沒有正文,我想添加一個正文,但無法執行。 它的消息要么有正文,沒有附件,要么有附件,沒有正文
#!/bin/bash
TmpMailFile=test.mail.msg
FROM="test@test.com"
TO="test@test.com"
uuencode /tmp/test.txt test.txt >> ${TmpMailFile}
SUBJECT="Test Subject"
echo "Test Body" >> ${TmpMailFile}
mail -s "${SUBJECT}" ${TO} -- -r ${FROM} < ${TmpMailFile}
rm ${TmpMailFile}
試試這個代碼:
mailx -s "$email_subject" $EmailRecipients << EOM 'uuencode $exp_file $exp_file`
Please find the file attached
Message in Body goes here.............
EOM
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.