簡體   English   中英

我想在外殼腳本中發送帶有html正文和附件的郵件

[英]i want to send mail with html body and attachment in shell script

在執行此腳本時,我得到了一個行附件,我得到了一個空白的zip文件,但是我現有的zip文件好了,沒有任何問題。 請有人幫我解決這個問題,我已經從網絡上嘗試了很多,但是沒有用。

export BODY=test.html
(
echo "To:"xyz@abc.com;
echo "Subject:QC Count failed report Please find Attachment.";
echo "MIME-Version: 1.0";
echo "Content-Type:multipart/mixed; boundary=\"B835649000072104Jul07\"";

echo "--B835649000072104Jul07";
echo "Content-Type: text/html; charset=\"UTF-8\"";
echo "Content-Transfer-Encoding: 7bit";
echo "Content-Disposition: inline";
echo "";
echo "";
cat $BODY
echo "--B835649000072104Jul07";
echo "Content-Disposition: attachment; filename=\"$FAILED_ZIP\"";
echo "--B835649000072104Jul07";

) | sendmail -t

關於使用swaks命令並附加拉鏈呢?

swaks -t "abc@xyz.com" -f "noreply@example.com" --header "Subject: QC Count failed report Please find attached" --body " Here are results" --attach /path/to/the/zip/file

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

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