1825780 Members
2431 Online
109687 Solutions
New Discussion

Elm

 
SOLVED
Go to solution
Shondra Eppinger
Occasional Advisor

Elm

Does anyone know how to send a elm mail message with an attachment.

For EXAMPLE: If I have a script and it is e-mailing users on issues and I want to attach a file and have it show up within the e-mail but not active. The user would need to select it before being able to read it.

R-
7 REPLIES 7
A. Clay Stephenson
Acclaimed Contributor

Re: Elm

Hi Rick,

Yes, it's actually quite easy.

Within the body of your email add this:

[include /tmp/myattach application/octet-stream base 64]

That will attach /tmp/myattach. You can include multiple attachments using the same 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.

Regards, Clay
If it ain't broke, I can fix that.
Shondra Eppinger
Occasional Advisor

Re: Elm

Clay:

It works, kinda. It created two files. One file specifies the whole path to my file. The other file containes the message, with the recipients. So what I'd like is only the one file. is there a switch that will turn off the send file?

R-
A. Clay Stephenson
Acclaimed Contributor

Re: Elm

Hi Rick,

I don't understand your question. If the 'myletter' file contains the include statement along with any desired message text then each addressee should see your message text and "myattach" within the email as an attachment. Are you looking for something different?

Clay
If it ain't broke, I can fix that.
Shondra Eppinger
Occasional Advisor

Re: Elm

Sorry, let me try again.

What we are getting with your syntax is the mail message with two attachments inside of it. The first attachment inside of the mail message has the information we wanted to send along with the include statement at the top. The second attachment is exactly what we want. It contains on the information of the attachment. The question is how do we get ride of the first attachment inside of the mail message?

R-
A. Clay Stephenson
Acclaimed Contributor

Re: Elm

Ok Rick,

I think I see the problem. My posting should have read 'base64' rather than 'base 64'. This pesky UNIX, spelling counts!

Sorry about that, Clay
If it ain't broke, I can fix that.
Shondra Eppinger
Occasional Advisor

Re: Elm

No, I am not using binary. So I subsituted the base 64 stuff with the text version.

R-
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: Elm

Hi again Rick,

I see what happened now. You improved the code to text/plain type and subtype. Most mail programs will simply include text in the body
of the document not what you want. Leave it octet/stream and either base64 or quoted-printable encoding and you should be fine.

I've attached a fully functional version which sends the same message with attachment to 2 users.

Hopefully we're done, Clay
If it ain't broke, I can fix that.