Index: MailTag.java =================================================================== RCS file: /home/cvs/jakarta-taglibs/mailer/src/org/apache/taglibs/mailer/MailTag.java,v retrieving revision 1.9 diff -u -r1.9 MailTag.java --- MailTag.java 31 Oct 2002 05:01:27 -0000 1.9 +++ MailTag.java 10 Dec 2003 06:32:46 -0000 @@ -119,6 +119,11 @@ * false * * + * port + * false + * false + * + * * session * false * false @@ -199,6 +204,12 @@ private String reset_server = null; /** + * provide the server port here for a new session + */ + private String port = "25"; + private String reset_port = null; + + /** * can be "text" or "html" (otherwise text is default) */ private String type = "text/plain"; @@ -295,6 +306,7 @@ reset_replyto = null; reset_subject = null; reset_server = null; + reset_port = null; name.clear(); value.clear(); bodyparts.clear(); @@ -383,6 +395,12 @@ } else { props.put("mail.smtp.host", server); } + // set port to server + if (reset_port != null) { + props.put("mail.smtp.port", reset_port); + } else { + props.put("mail.smtp.port", port); + } // set properties to deal will SendFailedExceptions // send to all legal addresses props.put("mail.smtp.sendpartial", "true"); @@ -698,6 +716,16 @@ } /** + * set the server port to be used for the mail session + * + * @param value string that is the server port to be used + * + */ + public final void setPort(String value) { + port = value; + } + + /** * set the jndi named session to be used to find the mail session * * @param value string that is the jndi named session @@ -847,6 +875,15 @@ */ protected final void resetServer(String value) { reset_server = value; + } + + /** + * reset the SMTP server port + * + * @param value string that is SMTP server port + */ + protected final void resetPort(String value) { + reset_port = value; } }