Discussion Locked

Attachment in Sendmail

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,

I want to both pipe an output report and send an attachment in the same mail.
The output report was easy, but how do I get the attachment sent along with the output report to the mail address I specify?

Send replies to:
amber.forsmark@visualwireless.com

6 replies

by william shipway

Try this...

------------ snip snip

#!/bin/sh
#
# sending attachments via sendmail
# W.Shipway 30-May-2001

SUBJECT="Attached files"
TOADDR="amber.forsmark@visualwireless.com"
#CCADDR="nobody@nowhere.com"

AFILE=/oracle/init.ora

/usr/bin/mailx -s "${SUBJECT}" "${TOADDR}" <<-EOF
Hi, here are two attached files:

First is the foo.sh script
~< ! uuencode foo.sh foo.sh

Second is an Oracle startup file
~< ! uuencode $AFILE `basename $AFILE`

Regards
William

~.
EOF
------------ snip snip

HTH
William

by dbunda

On system V UNIX, there is also a "mailto" command that attaches a file. not sure if it will help bo "both", but it might.

This discussion is closed to new replies.