Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Tomcat Users »

Tomcat 4.1.18 MailSession Problem

Cord Awtry

2003-12-21


Hello all,

       I'm hoping someone can given me some help here. I'm
attempting to set up a mail session but I can't seem to get Tomcat to
use the specified host of the mail server, it keeps using only
localhost.

       In my web.xml, I have:

<resource-ref>
  <description>My Mail Server</description>
  <res-ref-name>mail/MyMail</res-ref-name>
  <res-type>javax.mail.Session</res-type>
  <res-auth>Container</res-auth>
</resource-ref>

       And in the server.xml, I have:

<ResourceParams name="mail/MyMail">
  <parameter>
   <name>mail.smtp.host</name>
   <value>smtp.myserver.com</value>
  </parameter>
</ResourceParams>

       No matter what I do I get error from the mail server that it
can't relay my message. When I debug this and look at the session, the
mail.smtp.host is set to localhost.

       Any idea on what I've done wrong?

       Thanks in advance for any help,

               -C-
©2008 junlu.com - Jax Systems, LLC, U.S.A.