From owner-freebsd-questions@FreeBSD.ORG Fri Jul 23 07:47: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 4AED716A4CE for ; Fri, 23 Jul 2004 07:47:53 +0000 (GMT) Received: from mail.8ball.co.za (8ball.co.za [196.22.201.157]) by mx1.FreeBSD.org (Postfix) with ESMTP id 23AE243D54 for ; Fri, 23 Jul 2004 07:47:49 +0000 (GMT) (envelope-from nelis@8ball.co.za) Received: (qmail 26161 invoked by uid 89); 23 Jul 2004 07:47:24 -0000 Received: from unknown (HELO ?192.168.10.9?) (192.168.10.9) by 192.168.10.1 with SMTP; 23 Jul 2004 07:47:24 -0000 From: Nelis Lamprecht To: Murray Taylor In-Reply-To: <1090562873.349.22.camel@wstaylorm.dand06.au.bytecraft.au.com> References: <200407162036.i6GKaNt11099@www.plutao.lusodigital.net> <200407202324.30211.jaymo@cromagnon.cullmail.com> <20040721090847.F85700@chylonia.3miasto.net> <200407230057.06978.jaymo@cromagnon.cullmail.com> <1090562873.349.22.camel@wstaylorm.dand06.au.bytecraft.au.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-yNt3I9vIDi1+wIfDOr4p" Organization: 8ball Network Solutions Message-Id: <1090568822.31569.26.camel@nelis.brabys.co.za> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 Date: Fri, 23 Jul 2004 09:47:45 +0200 cc: carla.neves@nereus.pt cc: Wojciech Puchar cc: jaymo@cromagnon.cullmail.com cc: freebsdquestions cc: Murray Taylor 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: nelis@8ball.co.za List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 23 Jul 2004 07:47:53 -0000 --=-yNt3I9vIDi1+wIfDOr4p Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Fri, 2004-07-23 at 08:07, Murray Taylor wrote: > This works with winblows - I use it in production here >=20 > cat file | uuencode tgt_filname | mail -s "subject" test@example.com > ^ ^ > | +--- attachment FILENAME for the target host to > use > +--- attachment CONTENT from the source host >=20 May I suggest an alternative - /usr/ports/mail/p5-Mail-Sender Install this perl module and then you can easily write a simple script to handle your attachments. Something like the following: #!/usr/local/bin/perl -w use Mail::Sender; =20 $to =3D $ARGV [0]; $replyto =3D "someone\@domain.com"; $subject =3D $ARGV [1]; $file =3D $ARGV [2]; $mesg =3D $ARGV [3]; $from =3D "someone\@domain.com"; =20 if (! $file ) { PrintUsage(); die "\n"; } =20 else { =20 $sender =3D new Mail::Sender {smtp =3D> 'your.smtp.server.ip', from =3D> $from}; =20 $sender->MailFile({ to =3D> $to, replyto =3D> $replyto, subject =3D> $subject, msg =3D> $mesg, file =3D> $file}); =20 print "The file $file has been sent to $to\n"; }; =20 sub PrintUsage { print "Usage: mailfile.pl "; }; Not tested but should work, just alter to suit your needs. Regards, --=20 Nelis Lamprecht PGP: http://www.8ball.co.za/pgpkey/nelis.asc "Unix IS user friendly.. It's just selective about who its friends are." --=-yNt3I9vIDi1+wIfDOr4p Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (GNU/Linux) iD8DBQBBAMJ2QfIMKiRMCrERAuUqAKCuIuPymvijEBtdXcZ9iyIQLgYyEwCg5ju3 hgowQnxvv0aG+Q/imVLP2AE= =pxwj -----END PGP SIGNATURE----- --=-yNt3I9vIDi1+wIfDOr4p--