![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Rules & FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| How do I send email? How do I send an mail attachment from the command line? |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Send email from unix (AIX) with PDF attachment | sunjup | AIX | 0 | 03-14-2008 12:12 PM |
| send email from unix with attachment | chiru_h | Shell Programming and Scripting | 1 | 08-13-2007 10:18 AM |
| unix to Lotus Notes email attachment | wilsonchan1000 | UNIX for Dummies Questions & Answers | 7 | 02-09-2002 06:46 PM |
| unix to Lotus Notes email attachment | cowgilm | UNIX for Dummies Questions & Answers | 3 | 02-12-2001 01:21 PM |
| Transfering unix file as an email attachment | slivi | UNIX for Dummies Questions & Answers | 3 | 11-17-2000 07:54 AM |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I've written a a script which generates a report file, saved to a unix directory. I need to transfer it, via email, to some users. The command I'm using in my script is:
(note that subject & cur_address are set in the script prior to this line) cat /u/sandyl/sm_o_commdt_archive/c | uuencode weekly_commiss.doc | mail -s ",subject,cur_address The file gets emailed and attached correctly, but the problem is that the weekly_commiss.doc is 132 chars wide, so it wraps when I open it in Word. Even if I change the setup to landscape within Word, it still wraps some of the characters. Is there any way in unix to either change the font size smaller, or some other formatting, such that when it gets emailed it will already be in the appropriate format for the user to receive it? Thanks for your help. |
| Forum Sponsor | ||
|
|
|
||||
|
If your input file is ascii, you can format it using nroff(1) or troff(1).
Example: nroff /u/sandyl/sm_o_commdt_archive/c Will format the file and display it to the screen so that both left and right margins are evenly adjusted. Of course, you can then pipe it uuencode, or whatever you need to do. nroff defaults to 6.5 inch lines, 11 inch long paper. Read the nroff or troff man pages for more info, but that example should work....let us know if not. HTH |
|
|||
|
Final resolution
Thank you both for your suggestions - they were very helpful, and eventually led me to a final solution.
Changing the original report while still in Unix was not an option - this particular report is also run by the users from a menu. My task was to get that report emailed to managers on a weekly basis, and it has to be the same report as when they run it themselves. But I did run with your idea of changing the file type before it was transferred. I ended up using an ".wri" (Windows Write file type). Then, when the user opens their Outlook email message, they find an attached document, perfectly formatted, and they are able to use the windows scroll bars to shift view right & left to see the whole file. Here's the resulting code line that sends the email message: cat /u/sandyl/sm_o_commdt_archive/c | uuencode weekly_commiss.wri | mail -s ",subject,cur_address Thanks again for your suggestions. |
|||
| Google UNIX.COM |