You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by ba...@apache.org on 2001/01/31 04:59:27 UTC
cvs commit: xml-cocoon/src/org/apache/cocoon/processor/xsp/library/mail sendmail.xsl
balld 01/01/30 19:59:27
Modified: src/org/apache/cocoon/processor/xsp/library/mail
sendmail.xsl
Log:
fixed variable prefixes
Revision Changes Path
1.4 +13 -13 xml-cocoon/src/org/apache/cocoon/processor/xsp/library/mail/sendmail.xsl
Index: sendmail.xsl
===================================================================
RCS file: /home/cvs/xml-cocoon/src/org/apache/cocoon/processor/xsp/library/mail/sendmail.xsl,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- sendmail.xsl 2000/12/14 20:24:02 1.3
+++ sendmail.xsl 2001/01/31 03:59:26 1.4
@@ -77,10 +77,10 @@
<xsp:include>java.util.Properties</xsp:include>
</xsp:structure>
<xsp:logic>
- static Properties _properties;
+ static Properties _sendmail_properties;
static {
- _properties = new Properties();
- _properties.put("mail.smtp.host","127.0.0.1");
+ _sendmail_properties = new Properties();
+ _sendmail_properties.put("mail.smtp.host","127.0.0.1");
}
</xsp:logic>
<xsl:apply-templates/>
@@ -95,23 +95,23 @@
<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 {
- Properties _properties = new Properties(this._properties);
+ Properties _sendmail_properties = new Properties(this._properties);
if (!"null".equals(String.valueOf(<xsl:copy-of select="$smtphost"/>))) {
- _properties.put("mail.smtp.host",String.valueOf(<xsl:copy-of select="$smtphost"/>));
+ _sendmail_properties.put("mail.smtp.host",String.valueOf(<xsl:copy-of select="$smtphost"/>));
}
Session _sendmail_session = Session.getDefaultInstance(_properties,null);
- Message _message = new MimeMessage(_sendmail_session);
- InternetAddress _from = new InternetAddress(String.valueOf(<xsl:copy-of select="$from"/>));
- _message.setFrom(_from);
- InternetAddress _to = new InternetAddress(String.valueOf(<xsl:copy-of select="$to"/>));
- _message.setRecipient(Message.RecipientType.TO,_to);
+ Message _sendmail_message = new MimeMessage(_sendmail_session);
+ InternetAddress _sendmail_from = new InternetAddress(String.valueOf(<xsl:copy-of select="$from"/>));
+ _message.setFrom(_sendmail_from);
+ InternetAddress _sendmail_to = new InternetAddress(String.valueOf(<xsl:copy-of select="$to"/>));
+ _message.setRecipient(Message.RecipientType.TO,_sendmail_to);
_message.setSentDate(new Date());
_message.setSubject(String.valueOf(<xsl:copy-of select="$subject"/>));
_message.setText(String.valueOf(<xsl:copy-of select="$body"/>));
- Transport.send(_message);
- } catch (AddressException e) {
+ Transport.send(_sendmail_message);
+ } catch (AddressException _sendmail_exception) {
<error type="user">Your email address is invalid.</error>
- } catch (MessagingException e) {
+ } catch (MessagingException _sendmail_exception) {
<error type="server">An error occured while sending email.</error>
}
</xsp:logic>