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

Sending SMTP message from Tcl with attached HTML file using MIME

137 views
Skip to first unread message

Dennis Lilla

unread,
Aug 1, 1999, 3:00:00 AM8/1/99
to
Hi:

I need to construct an SMTP email message on a Unix platform using Tcl. The
message will have an attachment file which is an HTML file and, I assume,
I'd use MIME to attach it. It's not clear to me how to specify the attached
file. Obviously, the HTML file is ASCII. Do I just attach it as an ASCII
file? Do I need to go through the BASE64 conversion for this HTML file?

I can communicate with our mail server using a socket from Tcl, and also
send a regular SMTP message without attachments. So it's just this MIME
stuff that is holding me up.

Any help (suggestions, links to other sites, etc.) you can give me is
greatly appreciated.

Thanks in advance,

Dennis Lilla

Jeffrey Hobbs

unread,
Aug 1, 1999, 3:00:00 AM8/1/99
to Dennis Lilla
Dennis Lilla wrote:
> I need to construct an SMTP email message on a Unix platform using Tcl. The
> message will have an attachment file which is an HTML file and, I assume,
> I'd use MIME to attach it. It's not clear to me how to specify the attached
> file. Obviously, the HTML file is ASCII. Do I just attach it as an ASCII
> file? Do I need to go through the BASE64 conversion for this HTML file?

See http://x27.deja.com/getdoc.xp?AN=506294008

--
Jeffrey Hobbs The Tcl Guy
jeffrey.hobbs at scriptics.com Scriptics Corp.

Darren New

unread,
Aug 1, 1999, 3:00:00 AM8/1/99
to

Dennis Lilla wrote:
> file. Obviously, the HTML file is ASCII. Do I just attach it as an ASCII
> file? Do I need to go through the BASE64 conversion for this HTML file?

You don't need to use BASE64 unless your HTML has characters outside the
range of 32-126, i.e., if it's not normal ASCII, but instead includes odd
control characters or high-bit characters, or unless you have lines more
than 1000 characters long. Use content-type:text/html in the header, and
leave out the content-transfer-encoding header.

--
Darren New / Senior Software Architect / MessageMedia, Inc.
San Diego, CA, USA (PST). Cryptokeys on demand.
Any sufficiently advanced diety is indistinguishable from an alien.

Hume Smith

unread,
Aug 2, 1999, 3:00:00 AM8/2/99
to
Darren New <dn...@messagemedia.com> wrote:
>Dennis Lilla wrote:
>> file. Obviously, the HTML file is ASCII. Do I just attach it as an ASCII
>> file? Do I need to go through the BASE64 conversion for this HTML file?
>
>You don't need to use BASE64 unless your HTML has characters outside the
>range of 32-126, i.e., if it's not normal ASCII, but instead includes odd
>control characters or high-bit characters

which are not necessary in HTML anyway. HTML has its own encoding for such
things, &#.

--
<URL:http://www.glinx.com/~hclsmith/>


0 new messages