1838642 Members
2175 Online
110128 Solutions
New Discussion

ELM & Files Attachments

 
SOLVED
Go to solution
Jeff Hagstrom
Regular Advisor

ELM & Files Attachments

From a program, I want to use elm and attach a file to my email so that it comes as an attachment, not in the body of the email likd mailx.
12 REPLIES 12
Tom Danzig
Honored Contributor
Solution

Re: ELM & Files Attachments

uuencode | mailx user@domain
James Beamish-White
Trusted Contributor

Re: ELM & Files Attachments

V. V. Ravi Kumar_1
Respected Contributor

Re: ELM & Files Attachments

hi,
i think only way to send a file with elm is
elm -s "subject" "address" < "file name"

regds
Never Say No
MANOJ SRIVASTAVA
Honored Contributor

Re: ELM & Files Attachments

Jeff


ther are packages like mpack which do this stuff efficiently just donwload and run it with -s options , you can get more from :

http://www.stokely.com/unix.sysadm.resources/email.html#attachment.link



Manoj Srivastava
Jeff Hagstrom
Regular Advisor

Re: ELM & Files Attachments

All of these have done nothing more then mailx which is put the contents of the file into the body of the email. I want it to be a real live attachment.
Ceesjan van Hattum
Esteemed Contributor

Re: ELM & Files Attachments

Hi,
Have a look at
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x6b3fc4c76f92d611abdb0090277a778c,00.html
and read the comment of Frank Slootweg (2times) and Sanjay(!).
And ofcourse
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xdf44c4c76f92d611abdb0090277a778c,00.html
and its folluwups.

It seems that mpack really does the trick.

Succes,
Ceesjan
A. Clay Stephenson
Acclaimed Contributor

Re: ELM & Files Attachments

Elm will work just fine from the command line and it's quite easy.

Within the body of your email add this:

------------------------------------

This is my text. How are you?


[include /tmp/myattach application/octet-stream base64]

This is some more text in the middle.

[include /tmp/myexcel.xls application/ms-excel base64]

This is a closing message in the email.

----------------------------------------



That will attach /tmp/myattach and /tmp/myexcel.xls. You can include multiple attachments using this method. If you are running 10.20 make sure that you have a MIME enabled version of elm (PHNE_15835 or later).

Then to use it from a script:
elm -s "My Subject" user@mailserver.com < myletter

Where myletter contains the attachment include statement as well as your message text. It is also necessary that you have a .elm directory
under the users home directory becuase unlike the interactive version of elm the command-line version will not create a .elm directory automatically.

Regards, Clay
If it ain't broke, I can fix that.
benoit Bruckert
Honored Contributor

Re: ELM & Files Attachments

Hello,
Follow Ceesjan URL, In one of them, there's a url to nail, the product i'm using, which is very easy (like mailx, with an option to send files with attachment.

regards
BEnoit
Une application mal pansée aboutit à une usine à gaze (GHG)
Ceesjan van Hattum
Esteemed Contributor

Re: ELM & Files Attachments

Hi Jeff,
It would be nice to assign points. Not only for our pleasure, but we also would like to know whether or not you are helped with our effort. We wanna learn too!

Up until now, you've only assigned 50% of all responses.. :(
Cameron_13
Occasional Advisor

Re: ELM & Files Attachments

Clay,

I tried your method to attach a file (test.238.gz) to an e-mail and send it using elm.

Instead of seeing the attachment in the e-mail I recive I simply see the text [include /tmp/archcomp.238.gz HP-UX/gz base64]

Ideas?
A. Clay Stephenson
Acclaimed Contributor

Re: ELM & Files Attachments

That's because the brackets got mangled during a Forums data conversion:
[ ==> '['
] ==> ']'

[include /tmp/archcomp.238.gz HP-UX/gz base64]

should be:
[include /tmp/archcomp.238.gz HP-UX/gz base64]

If it ain't broke, I can fix that.
Cameron_13
Occasional Advisor

Re: ELM & Files Attachments

Clay,

That worked perfectly, my file is now being attached. One last problem though. When i open the file which I name test.238.txt.gz all the spaces are removed. Is there any way I can stop this from happaning?

Thanks

Cam