Configuring FreeBSD 6.2 to use sendmail for sending only
Chuck Swiger
cswiger at mac.com
Thu Aug 30 17:19:30 PDT 2007
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 at mac.com>' >> /tmp/$$.msg
echo 'To: xrayv19 at 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
More information about the freebsd-questions
mailing list