Operating System - HP-UX
1752781 Members
5983 Online
108789 Solutions
New Discussion

Send mails with attachments

 
Andrej Vavro
Frequent Advisor

Re: Send mails with attachments

Hi Yogee,

I had been using this:

(
echo "Subject: Text in the subject line"
echo "Text in email body"

uuencode
) | /usr/sbin/sendmail recipient@comp.com


This works fine. You can add needed extension to to open it with appropriate appl in windows.

Andrej
Yogeeraj_1
Honored Contributor

Re: Send mails with attachments

Thank you everybody for you replies.

I have temporarily done the following modifications to my scripts:
===============================================
...
if ($5 == '') then
mail $1 < $3
else
if (`ls $5|cut -f 2 -d"."` == 'txt') then
echo "`cat $3` \n[include $5 text/plain base64]"|elm -s "$2" $1
else if (`ls $5|cut -f 2 -d"."` == 'pdf') then
echo "`cat $3` \n[include $5 application/pdf base64]"|elm -s "$2" $1
else if (`ls $5|cut -f 2 -d"."` == 'htm') then
echo "`cat $3` \n[include $5 text/html base64]"|elm -s "$2" $1
else
mail $1 < $5
endif
endif
# Delete the message file.
if ($4 == 'delete') then
rm $3
endif
# Delete the attach file.
if ($6 == 'delete') then
rm $5
endif
...
===============================================

Hope that i have not missed out anything.

Best regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)