Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Receiving mail through unix with attachment

Status
Not open for further replies.

bbktech

Technical User
May 22, 2001
1
0
0
US
Hello,
I want to receive a mail through unix in a /var/mail with attachment. How do I download a attachemnet through a script.

Bhagwat
 
uuencode - This is the original method to send encoded text within a message. It is not an attachment as we think of them today but is still used enough to warrant putting it here.
uuencode $ATTFILE $ATTFILE | mail -s "$SUBJECT" $MAILTO

(uuencode $FILE1 $FILE1; uuencode $FILE2 $FILE2) | mail -s "$SUBJECT" $MAILTO

simple shell commands - For a very simple text (plain or html) attachment with just one file:
echo "From: $LOGNAME\nTo: $MAILTO\nSubject: $SUBJECT\nMime-Version: 1.0\nContent-Type: text/plain\n" > /tmp/file
cat $TXTFILE >> /tmp/file
/usr/lib/sendmail -t -oi < /tmp/file

Hope this will help you.
 
You can use the free ware utility : mpack.

We have integrated some of our oracle applications report outputs to be sent as mail attachment to end users.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top