Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Aug 2007 17:19:04 -0700
From:      Chuck Swiger <cswiger@mac.com>
To:        L Goodwin <xrayv19@yahoo.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Configuring FreeBSD 6.2 to use sendmail for sending only
Message-ID:  <7F3D4980-4827-4877-A33A-E294F7777464@mac.com>
In-Reply-To: <551986.10942.qm@web58113.mail.re3.yahoo.com>
References:  <551986.10942.qm@web58113.mail.re3.yahoo.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Aug 30, 2007, at 5:01 PM, L Goodwin wrote:
> Chuck, I'd prefer to have the script handle the
> mailing  so I can test the script (with email send)
> manually, independent of cron.
>
> Still looking for specifics on setting this up and a
> bourne shell script example that sends an email.
> Thanks!

I just ran this:

	-------

#! /bin/sh

SENDMAIL=/usr/libexec/sendmail/sendmail

rm -f /tmp/$$.msg
touch /tmp/$$.msg
echo 'From: Chuck <cswiger@mac.com>' >> /tmp/$$.msg
echo 'To: xrayv19@yahoo.com' >> /tmp/$$.msg
echo 'Subject: test message via a shell script' >> /tmp/$$.msg
echo >> /tmp/$$.msg
echo 'A test message body.' >> /tmp/$$.msg
echo >> /tmp/$$.msg
cat mailout.sh >> /tmp/$$.msg
echo >> /tmp/$$.msg
echo '-- ' >> /tmp/$$.msg
echo '-Chuck' >> /tmp/$$.msg

$SENDMAIL -i -t < /tmp/$$.msg
rm /tmp/$$.msg

	-------

If we're lucky, you just got emailed the content of the script  
above.  :-)

-- 
-Chuck




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?7F3D4980-4827-4877-A33A-E294F7777464>