Re: Configuring FreeBSD 6.2 to use sendmail for sending only



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@xxxxxxx>' >> /tmp/$$.msg
echo 'To: xrayv19@xxxxxxxxx' >> /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

_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"



Relevant Pages