--- sendmail.xsl.old	Fri Nov 16 10:16:21 2001
+++ sendmail.xsl	Fri Nov 16 10:16:07 2001
@@ -191,6 +191,12 @@
   <xsl:variable name="to"><xsl:call-template name="get-nested-string"><xsl:with-param name="content" select="sendmail:to"/></xsl:call-template></xsl:variable>
   <xsl:variable name="subject"><xsl:call-template name="get-nested-string"><xsl:with-param name="content" select="sendmail:subject"/></xsl:call-template></xsl:variable>
   <xsl:variable name="body"><xsl:call-template name="get-nested-string"><xsl:with-param name="content" select="sendmail:body"/></xsl:call-template></xsl:variable>
+  <xsl:variable name="mime-type">
+    <xsl:choose>
+      <xsl:when test="sendmail:body/@mime-type"><xsl:value-of select="sendmail:body/@mime-type"/></xsl:when>
+      <xsl:otherwise>text/plain</xsl:otherwise>
+    </xsl:choose>
+  </xsl:variable>
   <xsl:variable name="smtphost"><xsl:call-template name="get-nested-string"><xsl:with-param name="content" select="sendmail:smtphost"/></xsl:call-template></xsl:variable>
   <xsp:logic>
     try {
@@ -206,7 +212,7 @@
       _sendmail_message.setRecipient(Message.RecipientType.TO,_sendmail_to);
       _sendmail_message.setSentDate(new Date());
       _sendmail_message.setSubject(String.valueOf(<xsl:copy-of select="$subject"/>));
-      _sendmail_message.setText(String.valueOf(<xsl:copy-of select="$body"/>));
+      _message.setContent(String.valueOf(<xsl:copy-of select="$body"/>), String.valueOf("<xsl:copy-of select="$mime-type"/>"));
       Transport.send(_sendmail_message);
     } catch (AddressException _sendmail_exception) {
       <error type="user">Your email address is invalid.</error>

