Discussions

EJB programming & troubleshooting: how to configure an SMTP server without modifying my source code

  1. Hi gurus..

    I have developed an ear file (MDB's, Session beans, entity beans) and I want it to be as portable as possible.

    One of the requirements of my project is to send emails, so the javamail api is my choice. But I found that I need to specify the SMTP server. That means that I would have to dig into my code and modify my ear file everytime I'm using other SMTP server on different locations.

    is there anyway that I can configure this, for example, using and XML configuration file?

    thanks
  2. why can't u define this as a property in the config files or a java property