Niclas Hedhman wrote:
Thanks, The problem is that the SMTPTargetFactory is looking for a javax.mail.SessionOn Monday 26 July 2004 13:01, Leif Mortenson wrote:
I was also wondering why the SMTPTargetFactory simply does not allow you
to specify the SMTP host in its configuration. If that was possible,
then it would
be easy to completely self contain the configuration information for
sending the
log events.
I am shooting in the dark, but perhaps it can give you some ideas;
JavaMail looks for a "mail.properties" resource, in which most stuff can be configured. Perhaps it is enough to make it available in the classloader.
instance on the Context. When normally working with JavaMail, I understand how this
Session object is normally created. In this case however, I am just getting stuck trying
to figure out how that Session object is supposed to find its way into the Context.
To create the Session instance, you just do this:
// Setup the session properties for the message.
Properties sessionProperties = new Properties();
sessionProperties.put( "mail.smtp.host", m_smtpHost );
sessionProperties.put( "mail.smtp.port", Integer.toString( m_smtpPort ) );
// Get session
Session session = Session.getDefaultInstance( sessionProperties, null );
The mail.properties file could be a good way to specify the host/port of the SMTP
server as well. But the current implementation is still looking for its own Session.
Once option is to enhance this Factory, but I want to make sure I understand why it
is written the way it is and how it was designed to be used before playing around
with it.
Cheers, Leif
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Apache Excalibur Project -- URL: http://excalibur.apache.org/
