mailx-发送zip文件

发布于 2025-02-11 06:32:43 字数 466 浏览 0 评论 0原文

我有一个名为:zip_final.zip的zip文件,

我必须将此文件作为附件附加并发送邮件。

另外,我必须显示邮件主体中zip文件中的所有file_names。

我有此代码:

export files_list=`unzip -Zl zip_final.zip`

mailx -a ${zip_final.zip} -s "Files list | Zip file" << EOM

   Hi team, sent zip file.
   Files inside it are  :  $files_list

   Thank you.

EOM

但是如果我这样做,则不会发送邮件。就像邮件命令甚至没有被调用/触发。我什至没有收到任何错误消息。

有人可以建议如何使用mailx命令将邮政编码发送为附件,还可以在邮件正文中显示所有文件名?

I have a zip file named : zip_final.zip

I have to attach this file as a attachment and send the mail.

Also, I have to display all the file_names present inside the zip file in the mail body.

I have this code :

export files_list=`unzip -Zl zip_final.zip`

mailx -a ${zip_final.zip} -s "Files list | Zip file" << EOM

   Hi team, sent zip file.
   Files inside it are  :  $files_list

   Thank you.

EOM

But the mail is not sent if I am doing this. Like the mail command is not even getting called/triggered. I am not even getting any error messages too.

Can someone suggest how to send that zipfile as an attachment using mailx command and also display all the file names inside the zipfile in the mail body?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文