簡體   English   中英

用body發送附件的shell命令是什么?

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM