Re: [SLUG] html email from command line

From: Paul M Foster (paulf@quillandmouse.com)
Date: Thu Aug 02 2001 - 18:56:19 EDT


On Thu, Aug 02, 2001 at 01:39:07PM -0400, Mikes work account wrote:

> Yes, the email has to be in html format. What does MIME do and what is it?
> What is mpack( I could look this up you know,, but lazy seems appropriate on
> a rainy day!!)
>

Typically, email needs to be ASCII, that is, 8 bit bytes with the high
bit off (0). And typically, jpeg or other binary files contain lots of
bytes with the high bit set (1). If I'm not mistaken, MIME affords a way
of encoding this kind of file so that what you're sending out is ASCII
(high bit off), but looks like gibberish. Mpack does this conversion to
MIME on your end, at the command line.

> Is there a command sequence I use to accompolish all this? What happens on
> the other end? Will they see the pictures or do they have to do something to
> 'unpack' first?
>

Any decent email client should handle MIME-encoded files transparently.

Sendmail will accept a stream of ASCII bytes, regardless of the source.
What you need to do is set up a series of pipes and redirections to get
the file the way you want it. Then you feed it to sendmail. Check the
man page for mpack and sendmail. Probably, something like:

sendmail -r hisaddress@email.com < yourfile

or, if you have the To: line in the header of your email, you can do:

sendmail -t < yourfile

or

cat yourfile | sendmail -t

To build your file that you're going to send, you'd probably do
something like:

mpack [options] yourjpeg > mimejpeg
cat yourtext mimejpeg > yourfile

Anyway, Read The Fine Man pages; they are your friend. And then study up
in some simple Linux book on pipes and redirection. Just the thing for a
rainy day, right? ;-}

HTH,

Paul

P.S. Please make sure _I'm_ not on your list to send this stuff to. I
agree with Derek on HTML email.



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 18:30:41 EDT