I'm trying to send mail from my
JSP app. I've followed the instructions for configuring my server.xml to specify the address of my ISP's smtp server, as in:
<Resource name="mail/Session" auth="Container"
type="javax.mail.Session"/>
<ResourceParams name="mail/Session">
<parameter>
<name>mail.smtp.host</name>
<value>smtp.myservername.com</value>
</parameter>
</ResourceParams>
The odd thing is, I get an error message:
javax.servlet.ServletException: Sending failed;
nested exception is:
javax.mail.MessagingException: Could not connect to SMTP host: localhost, port: 25;
So it looks as though
tomcat is looking for the SMTP host on localhost, rather than on the SMTP server I specified.
With a Google search I found a few people asking the same question but no answers, so I guess it's something silly they figured out eventually. Any ideas?