haul 02/04/28 12:12:15 Modified: src/java/org/apache/cocoon/components/language/markup/xsp/java sendmail.xsl Log: Patch based on patch send by Jürgen Ehms. Logicsheet should work again. New tags charset, bcc. Revision Changes Path 1.7 +10 -3 xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java/sendmail.xsl Index: sendmail.xsl =================================================================== RCS file: /home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java/sendmail.xsl,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- sendmail.xsl 23 Apr 2002 09:52:59 -0000 1.6 +++ sendmail.xsl 28 Apr 2002 19:12:15 -0000 1.7 @@ -1,6 +1,6 @@ <?xml version="1.0"?> -<!-- $Id: sendmail.xsl,v 1.6 2002/04/23 09:52:59 haul Exp $--> +<!-- $Id: sendmail.xsl,v 1.7 2002/04/28 19:12:15 haul Exp $--> <!-- ============================================================================ @@ -56,7 +56,7 @@ * This is a stylesheet to send mail via the java mail API. * * @author Donald A. Ball Jr. - * @version CVS $Revision: 1.6 $ $Date: 2002/04/23 09:52:59 $ + * @version CVS $Revision: 1.7 $ $Date: 2002/04/28 19:12:15 $ --> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" @@ -271,14 +271,21 @@ _sendmail_message.setRecipient(Message.RecipientType.TO,_sendmail_to); _sendmail_message.setSentDate(new Date()); _sendmail_message.setSubject(String.valueOf(<xsl:copy-of select="$subject"/>)); + <xsl:choose> + <xsl:when test="sendmail:charset"> if (!"null".equals(String.valueOf(<xsl:copy-of select="$charset"/>))) { _sendmail_message.setText(String.valueOf(<xsl:copy-of select="$body"/>),String.valueOf(<xsl:copy-of select="$charset"/>)); } else { _sendmail_message.setText(String.valueOf(<xsl:copy-of select="$body"/>)); } + </xsl:when> + <xsl:otherwise> + _sendmail_message.setText(String.valueOf(<xsl:copy-of select="$body"/>)); + </xsl:otherwise> + </xsl:choose> Transport.send(_sendmail_message); } catch (AddressException _sendmail_exception) { - <error type="user">Your email address is invalid.</error> + <error type="user">Your email address is invalid.</error> } catch (MessagingException _sendmail_exception) { <error type="server">An error occured while sending email.</error> }
---------------------------------------------------------------------- In case of troubles, e-mail: [EMAIL PROTECTED] To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]