[vox-tech] emailing an attachment

andy wergedal vox-tech@lists.lugod.org
Thu, 26 Sep 2002 10:49:41 -0700 (PDT)


Here is the command line to email an attached file.

mail -s 'subject line' youraddress@domain.com < attachment

Here is how I use this technique to get my IP address.

<code>
#! /bin/sh

# my ip address file
lynx -dump ipchicken.com |grep 6 > messagefile.txt
mail -s 'Your IP' awerg@yahoo.com < messagefile.txt
rm -f messagefile.txt

</code>


-- Andy

--- Henry House <hajhouse@houseag.com> wrote:
> On Thu, Sep 26, 2002 at 08:53:31AM -0700, Tim Riley
> wrote:
> > Hi LUGOD:
> > 
> > Does anyone know how to email an attachment
> > from the command line?
> > 
> > I would expect it to be:
> > mail -s "Here is your graph" --attach-file graph.pdf
> foo@foo.com
> 
> The mail program is rather simple; I do not think that it
> supports MIME, the
> encoding standard that make attachments and non-ASCII
> messages possible. Try
> Mutt instead:
> 
> 	echo 'This is a test.' | mutt foo@foo.com -s 'Test' -a
> graph.pdf
> 
> -- 
> Henry House
> The attached file is a digital signature. See
> <http://romana.hajhouse.org/pgp>
> for information.  My OpenPGP key:
> <http://romana.hajhouse.org/hajhouse.asc>.
> 

> ATTACHMENT part 2 application/pgp-signature 



__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com