From owner-freebsd-questions@FreeBSD.ORG Sun Jul 18 16:13:53 2004 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3359C16A4CE for ; Sun, 18 Jul 2004 16:13:53 +0000 (GMT) Received: from cromagnon.cullmail.com (cromagnon.cullmail.com [67.33.58.202]) by mx1.FreeBSD.org (Postfix) with ESMTP id C534043D45 for ; Sun, 18 Jul 2004 16:13:52 +0000 (GMT) (envelope-from jamoore@cromagnon.cullmail.com) Received: from cromagnon.cullmail.com (localhost.cullmail.com [127.0.0.1]) i6IGIBtg078768; Sun, 18 Jul 2004 11:18:11 -0500 (CDT) (envelope-from jamoore@cromagnon.cullmail.com) Received: from localhost (localhost [[UNIX: localhost]]) by cromagnon.cullmail.com (8.12.10/8.12.10/Submit) id i6IGIANh078767; Sun, 18 Jul 2004 11:18:10 -0500 (CDT) (envelope-from jamoore) From: Jay Moore To: freebsd-questions@freebsd.org Date: Sun, 18 Jul 2004 11:18:10 -0500 User-Agent: KMail/1.6.1 References: <200407162036.i6GKaNt11099@www.plutao.lusodigital.net> <20040718153558.GB616@dhumketu.homeunix.net> In-Reply-To: <20040718153558.GB616@dhumketu.homeunix.net> MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200407181118.10375.jaymo@cromagnon.cullmail.com> cc: Carla Neves Subject: Re: How to send attached files on sendmail with mail tool? X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: jaymo@cromagnon.cullmail.com List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Jul 2004 16:13:53 -0000 On Sunday 18 July 2004 10:35 am, Shantanoo wrote: > | I'm doing some scripts to automaticly deliver to some email accounts > | Unix system printouts. I'm using sendmail on Freebsd 4.9 and the mail > | tool to send my emails. What I would like to know is: is it possible > | to send emails with files attached using the sendmail and the mail > | tool? Which syntax should I aply to send an attached file in the > | message? > | > | I would appreciate your help. > | > | P.S: I' using this syntax so far for sending emails > | > | mail -s "Automatic Message" recipient@example.com < | The contents of the message goes here. > | > | E_O_M > | > | or to pipe stuff directly into sendmail: > | > | /usr/sbin/sendmail -t -oi -oem < | To: recipient@example.com > | Subject: Automatic Message > | > | The contents of the message goes here. > | > | As much as you like, really. > | > | E_O_M > | > > I don't think you can do it. I would have used mutt in such case. > > e.g. > echo "contents of the bodt" | mutt -a attach_file -s "subject" > recipent@example.com > I don't see anything in 'man mail' that suggests mail could do this. I don't know about sendmail - it has a configuration option for "everything" :) , but may be more trouble than it's worth. You could do as Shantanoo suggested w/ mutt; there are probably similar incantations for pine, elm, etc. Doing it from a shell script is probably possible if you're willing to do all of the mime stuff. However, I think I'd look at Perl... I think if you found the right package this would be fairly straightforward. HTH, Jay