If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > Unix Shell Scripts > email script with attachment

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-08-03, 14:51
skd skd is offline
Registered User
 
Join Date: Sep 2003
Posts: 71
email script with attachment

currently i use to send email from unix
as

cat filename|mailx -s "XXX" $mail_list

is there any alternative to send file as attachment?

Thanks in advance
Reply With Quote
  #2 (permalink)  
Old 10-09-03, 07:43
EZEE! EZEE! is offline
Registered User
 
Join Date: Oct 2003
Location: East Coast of South Africa
Posts: 10
Here is an option but it requires postprint (on Solaris it is in /usr/lib/lp/postscript) and it also requires ps2pdf12 (a program that converts a postscript to pdf so that we can read it)
command 1
cat filename | postprint -s 8 -l 85 -n 2 | ps2pdf12 > filename.pdf
(postprint is formatting the text into 85 lines per page with 2 virtual
command 2 pages on 1 physical page, optional - you dont have to fo this)
uuencode filename.pdf filename.pdf | mailx -s "Subject" me@my.domain

if there is no formatting by postprint required you can pipe all together...

maybe not what you want but it may cause a spark.
Reply With Quote
  #3 (permalink)  
Old 10-09-03, 08:35
skd skd is offline
Registered User
 
Join Date: Sep 2003
Posts: 71
Thanks for quick response.

uuencode works on HP-UX.

uuencode filename.txt filename.txt|mailx -s "test" $mymail
wondering how do I use to send mutiple file attachement?
Reply With Quote
  #4 (permalink)  
Old 10-09-03, 09:37
EZEE! EZEE! is offline
Registered User
 
Join Date: Oct 2003
Location: East Coast of South Africa
Posts: 10
Unhappy

Sorry , dont know that one but it would be nice to know, I am running it for each report that I send. I am happy with it like this because the end user then has the option of putting a filter in her email program and filter by subject. If you do find a way to send multiple attatchment, please post answer... Ta very much!
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On