Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 May 1996 10:10:01 -0700 (MST)
From:      Terry Lambert <terry@lambert.org>
To:        admin@quebecweb.com
Cc:        questions@freebsd.org
Subject:   Re: Direct mail program
Message-ID:  <199605281710.KAA11302@phaeton.artisoft.com>
In-Reply-To: <199605281200.IAA21879@quebecweb.com> from "admin@quebecweb.com" at May 28, 96 08:00:50 am

next in thread | previous in thread | raw e-mail | index | archive | help
> I run FreeBSD 2.0 on a PC machine.
> 
> I look for a perl or sh program that let a file
> being mailed to a recipient (xxx@www.zzz)
> 
> This must be a file because i take a string coming from the web
> and put it in a temporary file. I print a copy of the file
> before to send it by fax, 
> but cannot send it by mail because of the CTRL-D that is 
> necessary to send mail.
> 
> I need a perl of sh routine that mail the file 
> to a recipient 

Redirect input; the end of the file is an implicit ^D.

#!/bin/sh
#
# sendfile
if test "x$2" == "x"
then
	echo "usage: sendfile <user@host> <filename>" >&2
	exit 1
fi

mail -s "File Transmission" $1 < $2
exit $?


					Terry Lambert
					terry@lambert.org
---
Any opinions in this posting are my own and not those of my present
or previous employers.



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