Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Nov 2000 13:00:25 -0000
From:      Daniel Podolsky <daniel.podolsky@twelvehorses.com>
To:        "'Dib, Allan L'" <Dib.Allan.L@edumail.vic.gov.au>, "'freebsd-questions@FreeBSD.ORG'" <freebsd-questions@FreeBSD.ORG>
Subject:   RE: Sending an attachment from the command line
Message-ID:  <856E94D34FF3D311B5FE00508B6B8BD223CCB8@BlackWidow.twelvehorses.int>

next in thread | raw e-mail | index | archive | help
This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.

------_=_NextPart_001_01C04B16.36DBFF48
Content-Type: text/plain;
	charset="iso-8859-1"

The simple solution is:
uuencode <YourFile> <YourFile> | mail -s "<YourFile>" <YourAddress>.
If you not happy with uuencode attachments you can use some sort of command
line mime encoder instead of uuencode...

-----Original Message-----
From: Dib, Allan L [mailto:Dib.Allan.L@edumail.vic.gov.au]
Sent: Friday, November 10, 2000 12:53 PM
To: 'freebsd-questions@FreeBSD.ORG'
Subject: Sending an attachment from the command line



Hiya everyone, 

I currently use the very useful 'mail' command from the command line and
from scripts to e-mail output of a progam. An example:

ls|mail -s "hello" dib.allan.l@edumail.vic.gov.au 

will e-mail me the output of the 'ls' command with a subject line "hello". 

I need to be able to e-mail a given (binary) file as an attachmentment with
a similar kind command. I have had no luck with man pages for either
sendmail or the 'mail' command. For example how would I e-mail someone the
file /home/allan/test.tar.gz with one command line.

If anyone could help me with this it would be greatly appreciated. 


------_=_NextPart_001_01C04B16.36DBFF48
Content-Type: text/html;
	charset="iso-8859-1"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<TITLE>Sending an attachment from the command line</TITLE>

<META content="MSHTML 5.00.2314.1000" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT color=#0000ff face="Courier New"><SPAN class=701215912-10112000>The 
simple solution is:</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face="Courier New"><SPAN 
class=701215912-10112000>uuencode &lt;YourFile&gt; &lt;YourFile&gt; | mail -s 
"&lt;YourFile&gt;" &lt;YourAddress&gt;.</SPAN></FONT></DIV>
<DIV><FONT color=#0000ff face="Courier New"><SPAN class=701215912-10112000>If 
you not happy with uuencode attachments you can use some sort of command line 
mime encoder instead of <FONT color=#0000ff face="Courier New"><SPAN 
class=701215912-10112000>uuencode...</SPAN></FONT></SPAN></FONT></DIV>
<BLOCKQUOTE 
style="BORDER-LEFT: #0000ff 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px">
  <DIV align=left class=OutlookMessageHeader dir=ltr><FONT face=Tahoma 
  size=2>-----Original Message-----<BR><B>From:</B> Dib, Allan L 
  [mailto:Dib.Allan.L@edumail.vic.gov.au]<BR><B>Sent:</B> Friday, November 10, 
  2000 12:53 PM<BR><B>To:</B> 'freebsd-questions@FreeBSD.ORG'<BR><B>Subject:</B> 
  Sending an attachment from the command line<BR><BR></DIV></FONT>
  <P><FONT size=2>Hiya everyone,</FONT> </P>
  <P><FONT size=2>I currently use the very useful 'mail' command from the 
  command line and from scripts to e-mail output of a progam. An 
  example:</FONT></P>
  <P><FONT size=2>ls|mail -s "hello" dib.allan.l@edumail.vic.gov.au</FONT> </P>
  <P><FONT size=2>will e-mail me the output of the 'ls' command with a subject 
  line "hello".</FONT> </P>
  <P><FONT size=2>I need to be able to e-mail a given (binary) file as an 
  attachmentment with a similar kind command. I have had no luck with man pages 
  for either sendmail or the 'mail' command. For example how would I e-mail 
  someone the file /home/allan/test.tar.gz with one command line.</FONT></P>
  <P><FONT size=2>If anyone could help me with this it would be greatly 
  appreciated.</FONT> </P></BLOCKQUOTE></BODY></HTML>

------_=_NextPart_001_01C04B16.36DBFF48--


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?856E94D34FF3D311B5FE00508B6B8BD223CCB8>