在linux中发送电子邮件作为主题和附件 [英] sending email in linux as subject and attachment

查看:140
本文介绍了在linux中发送电子邮件作为主题和附件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  1. 我有一个大约10列宽的文件,尝试将其作为正文发送. mailx无法将其作为正文发送,也无法作为ATT00001.bin文件和附件发送.

  1. I have a file that is about 10 columns wide and try to send it as body. mailx fails sending it as body and sends it as a ATT00001.bin file and as an attachment.

mail -s "Subject" emailaddress < file.tsv

有没有办法解决这个问题.

Is there way to solve this.

当我尝试使用uuencode将其作为附件发送时

When I try to send it as an attachment, using uuencode

echo "body" | uuencode inputattachment.tsv attachment.tsv) | mailx -s "subject" emailaddress

我收到一封电子邮件,其中包含经过编码的文本,如下所示:

I get an email with text that is encoded and looks like this:

begin 644 report7.tsv
M1&%T92`@("!3=&%T=7,@(#XS,"5V;VP@/C$P)75M("!T;W1A;"UL;V=S("`@
M("`@=6TE+6QO9W,@("`@("`@('1O=&%L+71R86YS("`@("!U;24M=')A;G,@
M("`@("`@=&]T86PM-2XR+C`@("`@('5M)2TU+C(N,"`@("`@("!T;W1A;"TU
M+C$N,"`@("`@=6TE+34N,2XP("`@("`@('1O=&%L+34N,"XP("`@("!U;24M
M-2XP+C`@("`@("`@=&]T86PM-"XR+C`@("`@('5M)2TT+C(N,"`@("`@("!T
M;W1A;"TT+C$N,2`@("`@=6TE+30N,2XQ("`@("`@('1O=&%L+30N,"XP("`@
M("!U;24M-"XP+C`@("`@("`@=&]T86PM=6YK;F]W;B`@('5M)2UU;FMN;W=N
M"C(P,30P,C(P"4-O;7!L971E9`E;)S4N,BXP)UT)6R=L;V<G+"`G=')A;G,G
M+"`G-2XR+C`G+"`G-2XQ+C`G+"`G-2XP+C`G70DQ,SDR-C4)-#4P+C`Y"3(Y
M,S@X-0DQ,#(W+C<).#<),"XP"3(W,C0S,0DU.#DN,3(),SDT.`DQ+C$S"3`)
M,"XP"3`),"XP"3`),"XP"3`),"XP#0HR,#$T,#(R,0E7:6YD;W<)6R=L;V<G
M+"`G=')A;G,G+"`G-2XQ+C`G+"`G-"XR+C`G70E;)VQO9R<L("=T<F%N<`

我该如何解决1和2?这与MS Outlook有关系吗?我将需要做一些MS Outlook支持的操作.

How do I solve 1 and 2? Does this have anything to do with MS outlook? I will need to do something that MS Outlook supports.

推荐答案

至少可以使用几个程序来发送带有附件的消息:

There are at least a couple of programs that you can use to send a message with attachments:

  1. 我的Linux系统上的mailx程序具有-a选项,用于将文件作为MIME部分附加:

  1. The mailx program on my Linux system has a -a option for attaching files as MIME parts:

echo Test body | mail -s "Test subject" -a test.txt test@example.com

  • Mutt 也会这样做:

  • Mutt will also do this:

    echo Test body | mutt -s "Test subject" -a test.txt -- test@example.com
    

  • 这篇关于在linux中发送电子邮件作为主题和附件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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