mailer1.jsp uses a JSP scriplet, invoking standard Java Mail API calls to send the message. mailer2.jsp uses taglib-mailer and taglib-request and a JNDI mail session resource.
When I use mailer1, all messages go out without problems.
The problem is, when I use mailer2.jsp, the first message goes out to the intended recipient. Any message that is sent from there, even from other users on different PC's, go to the same first recipient, no matter what address is specified by each user. All the rest (subject and message body) is different for each message. Only the original first recipient is "shared" by all sessions.
The JNDI resource is defined on the application context on server.xml, as follows :
<Resource name="mail/mi-mail" scope="Unshareable" type="javax.mail.Session"/> //it was
"shareable", same result
<ResourceParams name="mail/mi-mail">
<parameter>
<name>mail.smtp.host</name>
<value>my-mail-host</value>
</parameter>
</ResourceParams>and this is the taglib sender code on mailer2.jsp :
<[EMAIL PROTECTED] uri="/WEB-INF/taglibs-mailer.tld" prefix="mt"%>
<[EMAIL PROTECTED] session="true" isThreadSafe="true" errorPage="/errorpage.jsp"
isErrorPage="false"%>
<[EMAIL PROTECTED] uri="/WEB-INF/taglibs-request.tld" prefix="req"%>
....
<mt:mail session="java:/comp/env/mail/mi-mail">
<req:existsParameter name="to">
<mt:setrecipient type="to"><req:parameter name="to"/></mt:setrecipient>
</req:existsParameter>
<req:existsParameter name="from">
<mt:from><req:parameter name="from"/></mt:from>
</req:existsParameter>
<req:existsParameter name="cc">
<mt:setrecipient type="cc"><req:parameter name="cc"/></mt:setrecipient>
</req:existsParameter>
<req:existsParameter name="subject">
<mt:subject><req:parameter name="subject"/></mt:subject>
</req:existsParameter>
<req:existsParameter name="message">
<mt:message><req:parameter name="message"/></mt:message>
</req:existsParameter>
<mt:send>
<p>The following errors occured<br/><br/>
<mt:error id="err">
<jsp:getProperty name="err" property="error"/><br/>
</mt:error>
<br/>Please back up a page, fix the error and resubmit.</p>
</mt:send>
</mt:mail>I first noticed the problem, because I have a page (a form) that calls a second page that must generate two separate mail messages, with different texts for two separate recipients. It calls mailerX.jsp twice, via two separate <jsp:include> directives. When I include mailer2, both messages are delivered to whatever user first invoked it (mailer2) on some session. Both messages are indeed different, each one with its own subject and body. On the other hand, mailer1.jsp correctly delivers each message to each intended user.
I am using Apache 2 and Tomcat 4 (all latest versions).
Any ideas?
Thanks in advance,
Eulogio Robles
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
