Operating System - HP-UX
1833589 Members
3976 Online
110061 Solutions
New Discussion

Re: Attaching Emails and include Text

 
Joe Milici
Advisor

Attaching Emails and include Text

I have reviewed the responses regarding attaching a file but how can I add a message in the body as well?
4 REPLIES 4
Rodney Hills
Honored Contributor

Re: Attaching Emails and include Text

Since you didn't specify the email program you are using, I'll assume mailx.

cat body | mailx -s "subj line" joe@company.com

HTH

-- Rod Hills
There be dragons...
Steven E. Protter
Exalted Contributor

Re: Attaching Emails and include Text

Attaching a good script.

You will need to tweak it.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Joe Milici
Advisor

Re: Attaching Emails and include Text

Rodney, Where does the attachment come into play with your syntax?
A. Clay Stephenson
Acclaimed Contributor

Re: Attaching Emails and include Text

One of the easist tools to use is elm from the command line especially if you are sendiing multiple attachments and text.

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.


Then to use it from a script:
elm -s "My Subject" dumbo@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 senders home directory because unlike the interactive version of elm the command-line version will not create a .elm directory automatically
If it ain't broke, I can fix that.