Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP

 

Forums advanced search
HP.com Home
IT resource center forums > HP-UX > system administration

Sending attachments via elm from command line

» 

IT Resource Center

» Online help
» My profile
» Login
» Maintenance and support for hp products
» Maintenance and support for Compaq products
» Forums
» Training and education
» Site map

Member icons
 
 HP moderator  HP moderator
 Expert in this area  Expert in this area
Member status
ITRC Pro ITRC Pro
250 points
ITRC Graduate ITRC Graduate
500 points
ITRC Wizard ITRC Wizard
1000 points
ITRC Royalty ITRC Royalty
2500 points
ITRC Pharaoh ITRC Pharaoh
7500 points
Olympian Olympian
20000 points
1-Star Olympian 1-Star Olympian
40000 points
2-Star Olympian 2-Star Olympian
80000 points
»  How to earn points
»  Support forums FAQs
Question status
Magical answer Magical answer
Message with a response that solved the author's question
Favorites status
Add to my favorites Add to my favorites
Delete from my favorites Delete from my favorites
This thread has been closed Thread closed
 

Content starts here
   Create a new message    Receive e-mail notification if a new reply is posted  Reply to this message
Author Subject: Sending attachments via elm from command line      Add to my favorites
Unix Admins/Shane Savage
Sep 6, 2000 13:30:42 GMT   

I have tried various ways to send an attachment via elm using command line only.
I am generating various html files with various configs of our servers. I want to then email these to my offsite mail server to have a copy of my server configs off site.
Can someone tell me how to send the attachments through elm (or any other method) that can be coded into my collect scripts.
Note: If you are the author of this question and wish to assign points to any of the answers, please login first.For more information on assigning points ,click here


Sort Answers By: Date or Points
Stefan Farrelly This member has accumulated 20000 or more points
Sep 6, 2000 13:38:11 GMT  8 pts

Try;
uuencode [filename] [name you want for attachment] | sendmail xyz@abc.com

To send text attachments via elm or mutt from the command line, you would:

1. Edit the file and preceding the actual text add the following line:
[include text.txt text/plain base64]
The general format is: [include filename type/subtype encoding]
type/subtype= text/plain, image/gif, image/jgp etc..
encoding=base64, quoted-printable etc...

2. To send the mail and attachment with elm:
elm -s 'Testing' "recipient's email address" < test.txt
Kofi ARTHIABAH Expert in this area This member has accumulated 2500 or more points
Sep 6, 2000 13:38:19 GMT    Unassigned

Hi Shane... there have been a number of questions/threads on this issue.. you can do a search for "attachment" ...

http://my1.itrc.hp.com/cm/QuestionAnswer/1,1150,0x8e557e990647d4118fee0090279cd0f9,00.html

is one such thread...

I personally use the uuencode construct.
Tracey This member has accumulated 500 or more points
Sep 6, 2000 14:26:17 GMT  3 pts

I use the include method, but you need to make sure you are using a current copy of elm. THe last patches I installed for some reason disable my ability to attach - something I have been doing for many moons. I had to revert back to the previous version, which for me is 10.20 HP/UX and elm version 1.206.214.2
Rita C Workman This member has accumulated 7500 or more points
Sep 6, 2000 15:49:20 GMT  8 pts

I set this up here when the developers wanted a way to send reports via email (and use HPUX to send other file attachements...even if it was an Excel/Word file or image
file giff,tiff, etc..) They took this vehicle and included it straight into their job streams and set up their include files for whatever they needed...They tell me it works....Here it
is - I hope it helps you !
*******************************************
if your trying to attach a file and send the file via sendmail as an attachment than you can do this also.
First make sure you at least have Elm 2.4 on your box, and my example is for a HPUX 10.2 (you need MIME capability) so be sure you have patch PHNE_15835 (it doesn't cause a reboot to load). To give you an example I ftp'd an excel spreadsheet to my box called test.xls Then I did the following:
First create a dummy file with the following line (just as you see it here)
&#91;include test.xls application/msexcel base64&#93;

Second from the command line:
elm -s "This is a test" user@hp.com <dummy
============================================

What this did was email to user@hp.com the file test.xls (and it comes as attached excel file) with a subject line of This is a test.
You can do it with text files; image.jpg or gif files; and more. It's a very handy tool that programmers can add right into the job streams and email reports to users instead of
printing them....makes for paperless environment.

Here's an example for a simple text file:
.. just change your include to read something like this:
&#91;include error.file text/plain base64&#93;

Regards,
Rita C Workman This member has accumulated 7500 or more points
Nov 29, 2000 14:05:17 GMT    Unassigned

Tracy,

If you've lost the ability to send via 'include' check your patches.....I will bet you have PHNE_20505 loaded.
Remove this patch and then re-install PHNE_15835 (even it's already there-reload it).
I ran into the same problem and found out this is a patch that is part of one of the general release bundles....

Regards,
Rita
MANOJ SRIVASTAVA This member has accumulated 2500 or more points
Dec 5, 2000 17:03:58 GMT    Unassigned

On HPUX 11.00 the elm version to support attachments is 2.4 . and u can use the command :
elm - s ( SUBJECT ) addresss < file name . We also have 3rd party programs like mpack which do the same thing , and are simple to setup and use . MPACK is one of them you can down load the bin file from the site :
ftp://ftp.andrew.cmu.edu/pub/mpack

and run it to send the mail attachments . This is more simpler than elm setup as you can just down laod the bin file and put it in the bin directory .

also the command to be used to send the file is

mpack -s "Subject " <Filename to be attached> addresss.

In case you have problems in download I can send the mpack bin file as an attachment.

Manoj
 
Create a new message    Receive e-mail notification if a new reply is posted   Reply to this message
 
 
Printable version
Privacy statement Using this site means you accept its terms
© 2008 Hewlett-Packard Development Company, L.P.