catlett 01/06/28 09:57:02
Modified: mailer/src/org/apache/taglibs/mailer SendTag.java
Log:
fixed what was breaking th build it works
Revision Changes Path
1.7 +14 -11
jakarta-taglibs/mailer/src/org/apache/taglibs/mailer/SendTag.java
Index: SendTag.java
===================================================================
RCS file:
/home/cvs/jakarta-taglibs/mailer/src/org/apache/taglibs/mailer/SendTag.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- SendTag.java 2001/06/28 15:39:10 1.6
+++ SendTag.java 2001/06/28 16:56:54 1.7
@@ -1,7 +1,7 @@
/*
- * $Header:
/home/cvs/jakarta-taglibs/mailer/src/org/apache/taglibs/mailer/SendTag.java,v 1.6
2001/06/28 15:39:10 catlett Exp $
- * $Revision: 1.6 $
- * $Date: 2001/06/28 15:39:10 $
+ * $Header:
/home/cvs/jakarta-taglibs/mailer/src/org/apache/taglibs/mailer/SendTag.java,v 1.7
2001/06/28 16:56:54 catlett Exp $
+ * $Revision: 1.7 $
+ * $Date: 2001/06/28 16:56:54 $
*
* ====================================================================
*
@@ -402,7 +402,7 @@
return EVAL_BODY_TAG;
else {
// create the thread to mail the messge
- Mail mail = new Mail(message, pageContext, to);
+ Mail mail = new Mail(message, pageContext.getServletContext(), to);
mail.start(); // send the mail
@@ -461,12 +461,12 @@
private MimeMessage message = null; // the message to be sent
// used to get the servlet context for logging
- private PageContext pc = null;
+ private javax.servlet.ServletContext sc = null;
String mailto; // list of to address this message is being sent to
- Mail (MimeMessage mail, PageContext pagecontext, String to) {
+ Mail (MimeMessage mail, javax.servlet.ServletContext servletcontext , String
to) {
message = mail;
- pc = pagecontext;
+ sc = servletcontext;
mailto = to;
}
@@ -478,12 +478,15 @@
Transport.send(message);
} catch (MessagingException me) {
- // exception occurs when the any of the addresses cannot be properly
- // set in the message
- // since the JSP has already finished executing this exception will
+ // exception occurs when the e-mail cannot be sent to anyone of the
+ // to addresses in the message depending on the mail properties set
+ // this may or may not cause transmission of the message to end.
+ // This error will be logged and a message will be sent to the from
+ // address explaining that the message could not be sent.
+ // Since the JSP has already finished executing this exception will
// do nothing visible, however the errors should be dealt with by
// the SMTP host if it is configured correctly
- pc.getServletContext().log("The e-mail sent to " + mailto + " was not
sent: " + me.getMessage());
+ sc.log("Could not send the e-mail sent to " + mailto + ": " +
me.getMessage());
}
}
}