Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

command prompt SENDING MAIL

1 view
Skip to first unread message

Stephen Younger

unread,
Feb 22, 2002, 4:51:22 AM2/22/02
to
Hi all,

I currently am using the following command to send print files from of
Openserver 5

cat invoice.rep | mail -s "Invoices for today" ste...@xx.com

This copies the contents of the file (invoice.rep) into the message body,
but with different email packages/versions being used the formatting is
sometimes totally distorted.

What I want to really do is attached the file or even better multiple files
to the message, so the receiver sees them as attachments.

I know you can do this from within scomail, but I need to be able to do this
at the command prompt and it will all be done within shell scripts.

Any help would be much appreciated.

Best regards

Stephen Younger


Roberto Zini

unread,
Feb 22, 2002, 5:56:08 AM2/22/02
to

Hi !

As a possible solution, please search google for "mpack" or "munpack".

Best,
Roberto
--
---------------------------------------------------------------------
Roberto Zini email : r.z...@strhold.it
Technical Support Manager -- Strhold Evolution Division R.E. (ITALY)
---------------------------------------------------------------------
"Has anybody around here seen an aircraft carrier?"
(Pete "Maverick" Mitchell - Top Gun)

Bob Lawson

unread,
Feb 22, 2002, 6:01:17 AM2/22/02
to

I do this using Pine. Pine is a full-screen character based email
package. I have a script called PineSend that does exactly
what you are asking. It takes an email address, a message file
and then several files for attachments.

The way I did it was just run the program manually and figure out
the characters you use when interacting with the program. I then use
'echo' to generate those characters. Works great!

I'm not sure is Pine is avalable on the skunkware CD or not. I
downloaded and compiled mine.

Bob Lawson
Parkridge Consulting
Innovative Unix & Linux Solutions
Visit us at www.parkridge.on.ca
bla...@parkridge.on.ca

Gary Quiring

unread,
Feb 22, 2002, 10:11:04 AM2/22/02
to
On Fri, 22 Feb 2002 09:51:22 -0000, "Stephen Younger"
<Stephen...@kingsroadtyres.co.uk> wrote:

>Hi all,
>
>I currently am using the following command to send print files from of
>Openserver 5
>
>cat invoice.rep | mail -s "Invoices for today" ste...@xx.com
>
>This copies the contents of the file (invoice.rep) into the message body,
>but with different email packages/versions being used the formatting is
>sometimes totally distorted.
>
>What I want to really do is attached the file or even better multiple files
>to the message, so the receiver sees them as attachments.
>

You can download MUTT from Skunkware. It allows true attachments and works very
well from the command line.

Gary Q

Kirst Hulspas

unread,
Feb 22, 2002, 10:55:32 AM2/22/02
to
Yet an other way (no installs needed):

((cat file_you_want_to_send | uuencode name_you_want_to_call_it) ; echo
"This is the body") | mail -s "My subject " de...@dom.com

or, for multiple files:

for i in file1 file2 file3 ; do (cat $i |uuencode $i); done | mail -s "My
subject" de...@dom.com

These attachments are accepted by Outlook.
(Just noticed that my outlook 2000 changes a plain filename without
extention (like in the second example) to a .dat extension! ?? M$ quirk??)

good luck,
Kirst.


"Stephen Younger" <Stephen...@kingsroadtyres.co.uk> wrote in message
news:zwod8.2662$5o.15...@newsr2.u-net.net...

Brian K. White

unread,
Feb 23, 2002, 4:36:51 PM2/23/02
to

"Stephen Younger" <Stephen...@kingsroadtyres.co.uk> wrote in message
news:zwod8.2662$5o.15...@newsr2.u-net.net...

I wrote the following shell script to do this.
It is somewhat less than half-baked at the moment, but as it happens, all
the stuff I have not gotten around to doing to it, are pretty unneccesary,
else, I'd have finished adding the features. :)

basically, the idea is to take in text from any app that already prints,
and send it as email, and to insure the text gets displayed in the users
mail client in a fixed-width font, without trying to engage in the utterly
futile and thankless hell of convincing other people to change the
settings in their mail clients.... just send the mail as html and the only
"html" is that the whole mail is just wrapped in <pre> </pre> so if a user
does get the mail and is not using a fancy email client that understands
html, very minimal harm done. in order for the mail to show up properly
formatted and *not* require the user to open an attachment, the script
writes it's own mail headers, so that it can include a "content-type:
text/html" and it feeds the final product in to sendmail* instead of mail

(*) there is a dummy "sendmail" that works with this even on sco boxes
that have MMDF and not sendmail installed, don't worry about that. It
actually works on both sco and linux and the only thing you have to do is
change the path to sendmail in the script.


usage:

your-application >/tmp/textfile

reptmail H /tmp/textfile us...@host.com "subject line text"

requirements:
unpcl and ibm2ascii scripts, found in the same place below (they also work
on both sco and linux)

a head.html and a tail.html which are used to dress-up the email a little
more than having *just* <pre> </pre>. samples also provided below.

see:
http://www.aljex.com/bkw/filepro/

scroll down to "reptmail"
(pronounced "report-mail", as in, it emails reports)

of course it can easily just be edited to not require unpcl or head/tail
html.
unpcl just strips out hplaser pcl ecape codes, ibm2ascii translates ibm
line-drawing characters to plain-ascii approximations. this lets 95% of
the already existing reports generated from my application to be fed in
without making any changes to the application. and cat head.html ... cat
tail.html can be reduced to echo '<html><body><pre>' ... echo
'</pre></body></html>'


--
Brian K. White -- br...@aljex.com -- http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx Linux SCO Prosper/FACTS AutoCAD #callahans Satriani


0 new messages