Hi,
I'm trying to send e-mail from an Ant script. The message body
is a chunk of html that references a small number of png files
that I'm adding as attachments. I'd like the message to render
nicely in the mail client, but the problem I'm having is that I
can't control the MIME settings on the attachments.
The code looks like this:
<mail from="[EMAIL PROTECTED]"
tolist="[EMAIL PROTECTED]"
subject="Java WS/XML Stats for ${DSTAMP}"
messagefile="${reportdir}/index.html"
messagemimetype="text/html"
encoding="mime">
<fileset dir="${reportdir}">
<include name="*.png"/>
</fileset>
</mail>
Which almost works. I get a message that looks like the following
stripped down src. The message body is correctly set to "text/html",
but notice that the content type on the png attachments is wrong.
It should be "Content-type: image/png;..." Is there some way I
can control the MIME settings on the attachments?
Thanks,
--Ryan
From - Fri Apr 01 15:48:07 2005
Date: Fri, 01 Apr 2005 15:43:24 -0500
From: [EMAIL PROTECTED]
Subject: Java WS/XML Stats for 20050401
To: [EMAIL PROTECTED]
MIME-version: 1.0
Content-type: multipart/mixed; boundary="Boundary_(ID_nB9kKqgR9c+9aQGFJ43TyQ)"
--Boundary_(ID_nB9kKqgR9c+9aQGFJ43TyQ)
Content-type: text/html; charset=ISO646-US
Content-transfer-encoding: QUOTED-PRINTABLE
<html>
[...snip...]
</html>
--Boundary_(ID_nB9kKqgR9c+9aQGFJ43TyQ)
Content-type: application/octet-stream; name=0.png
Content-transfer-encoding: BASE64
Content-disposition: attachment; filename=0.png
[...snip...]
--Boundary_(ID_nB9kKqgR9c+9aQGFJ43TyQ)
Content-type: application/octet-stream; name=1.png
Content-transfer-encoding: BASE64
Content-disposition: attachment; filename=1.png
[...snip...]
--Boundary_(ID_nB9kKqgR9c+9aQGFJ43TyQ)
Content-type: application/octet-stream; name=2.png
Content-transfer-encoding: BASE64
Content-disposition: attachment; filename=2.png
[...snip...]
--Boundary_(ID_nB9kKqgR9c+9aQGFJ43TyQ)
Content-type: application/octet-stream; name=3.png
Content-transfer-encoding: BASE64
Content-disposition: attachment; filename=3.png
[...snip...]
--Boundary_(ID_nB9kKqgR9c+9aQGFJ43TyQ)--
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]