怎样在linux下用命令发带附件的邮件
Posted on 11月 21st, 2006 作者 哈哈
简单讲
就是把要当作附件发的文件uuencode一下
然后再把编过码之后的文件当作邮件正文发出去
一句话的命令就是
cat <attachfile> | uuencode <attachname> | mail -s <subject> <targetemailaddress>
比如我要把文件hello.gif当作附件发给haha@pei.com
邮件标题用hello
那么我会这样
cat hello.gif | uuencode hello.gif | mail -s "hello" haha@pei.com
注意:命令uuencode在rpm包sharutils里





用这个好像不是都行的
我用这个从服务器上发mp3到我的gmail信箱
好像gmail认不出是mp3附件
但是发到我公司信箱(exchange)
却又没有问题
搞不懂
难道是邮件编码的问题?