[ILUG] sending a file via email with a script
Conor Daly
conor.daly at oceanfree.net
Sat Sep 2 07:25:56 IST 2000
On Thu, Aug 31, 2000 at 12:57:05PM +0100 or so it is rumoured hereabouts,
Jeremy Smyth thought:
>
>
> > Using a script. How can i send a file as an attachment
> > via email. Cannot seen anything in the
> > sendmail book.
>
> <reply mode="lyda">
>
> 1 - it's in the archives about a month ago
That was for me.
> 2 - mutt -a attach.file -s "Subject" recipient at domain.com < /dev/null
> or replace /dev/null with a file containing the body text of the mail
> </reply>
Of course, i didn't have mutt available on the machine in question so I
was stuck with using mail. I found mimencode didn't work in any easy
fashion so I ended up using uuencode. It went something like this:
uuencode <File to attach> <Name of file in email message> | mail -s <subject> <recipient at domain>
--
Conor Daly <conor.daly at oceanfree.net>
Domestic Sysadmin :-)
More information about the ILUG
mailing list