Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [tlug] Using /bin/mail to send HTML mail from the command line?



>>>>> "Jean-Christian" == Jean-Christian Imbeault <Imbeault> writes:

    Jean-Christian> Is it possible to use /bin/mail to send HTML
    Jean-Christian> formatted mail from the command line? I can't seem
    Jean-Christian> to find a way to get mail to set the proper mail
    Jean-Christian> headers.

That's way outside the design parameters for /bin/mail, which is
probably a 30-year-old program by now.  Why do you want to do this?
Specifically, why won't mh, Pine, Mutt, elm, etc, etc, do?
Alternatively, if by "command line" you mean "batch", how about

$ cat tmp.msg
To: you
From: me
Subject: HTML mail should be illegal
Content-Type: text/html
Date: <today in RFC 2822 format>
Message-Id: <gotta-have-one@example.com>

<!-- The preceding null line (no whitespace) indicates the end of the
     mail headers. -->
<HTML>
<HEAD>
 <TITLE>HTML document</TITLE>
</HEAD>
<BODY>
 <P>A capital crime, in fact.</P>
</BODY>
</HTML>

$ /usr/sbin/sendmail -t <tmp.msg
$ 

There are also Perl, Python, and Ruby modules to help with the
formatting of mail and construction of RFC-conformant headers.


-- 
School of Systems and Information Engineering http://turnbull.sk.tsukuba.ac.jp
University of Tsukuba                    Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
               Ask not how you can "do" free software business;
              ask what your business can "do for" free software.


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links