在Sun Solaris上通过mailx分配附件 [英] Seding attachment through mailx on Sun Solaris

查看:103
本文介绍了在Sun Solaris上通过mailx分配附件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,





我的Shell脚本有一个难点。我想在Solaris服务器上使用mail或mailx和uuencode实用程序发送四个文本文件和一个csv文件作为附件。

它是Sun Microsystems SunOS 5.10

这是我的代码

Hi All,


I have one difficulty here with my Shell script. I want to send four text files and one csv file as attachment using mail or mailx and uuencode utility on Solaris server.
It is Sun Microsystems SunOS 5.10
Here is my code

( uuencode "file1.txt" "file1.txt" ; "file2.txt" "file2.txt" ; "file3.txt" "file3.txt" ; "file4.txt" "file4.txt" ; "file5.txt" "file5.txt"  )  | mailx -s "Subject" someone@abc.com < ~/maiBodytext.txt



现在的问题是,mailx正在发送邮件但没有任何附件。

我尝试了很多,也用google搜索。但找不到解决方案。



是否我们无法从SunO发送附件,因为我也尝试发送单个附件,但它失败了。



请注意,脚本和文件位于同一位置,即我的主目录。

此外,此脚本适用于具有相同版本的其他Solaris盒作为SunOs 5.10,但它来自Oracle公司。供应商规范是否重要。据我所知,甲骨文已经接管了Sun长期以来,为什么会有这种差异。



请帮帮我。



提前致谢!


Now the problem is, mailx is sending a mail but without any attachment.
I tried lot and googled too. But could not find the solution.

Is it the case that we cannot send attachment from SunOs cause i tried sending single attachment too, it failed.

Please note, both the script and the files are under same location i.e. my home directory.
Also, this script works on other Solaris box which has same version as SunOs 5.10 but it is from Oracle Corp. Does vendor specification matters. As far as i know, Oracle has took over Sun long back, then why there is this difference.

Please help me with this.

Thanks in advance!

推荐答案

尝试类似:

Try something like:
cat file1.txt file2.txt | uuencode | mailx -s "Subject" someone@abc.com < ~/mailBodytext.txt



参见:

http://unixhelp.ed.ac.uk/CGI/man-cgi?uuencode [ ^ ]

http://unixhelp.ed.ac.uk/CGI/man-cgi?mailx [ ^ ]


嘿,我找到了解决方法。以下是现在为我工作的内容

Hey i found the workaround on this. Following is what now working for me
( cat mailBody.txt; uuencode "abc.txt" "abc.txt"; uuencode "xyz.txt" "xyz.txt"; uuencode abc.csv abc.csv ) | mailx -s "attach test" someone@abc.com


这篇关于在Sun Solaris上通过mailx分配附件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆