public class SendMailFactory
extends java.lang.Object
implements javax.naming.spi.ObjectFactory
Can be configured in the Context scope of your server.xml configuration file.
Example:
<Resource name="mail/send" auth="CONTAINER" type="javax.mail.internet.MimePartDataSource"/> <ResourceParams name="mail/send"> <parameter><name>factory</name> <value>org.apache.naming.factory.SendMailFactory</value> </parameter> <parameter><name>mail.smtp.host</name> <value>your.smtp.host</value> </parameter> <parameter><name>mail.smtp.user</name> <value>someuser</value> </parameter> <parameter><name>mail.from</name> <value>someuser@some.host</value> </parameter> <parameter><name>mail.smtp.sendpartial</name> <value>true</value> </parameter> <parameter><name>mail.smtp.dsn.notify</name> <value>FAILURE</value> </parameter> <parameter><name>mail.smtp.dsn.ret</name> <value>FULL</value> </parameter> </ResourceParams>
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
DataSourceClassName |
Constructor and Description |
---|
SendMailFactory() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
getObjectInstance(java.lang.Object refObj,
javax.naming.Name name,
javax.naming.Context ctx,
java.util.Hashtable<?,?> env) |
protected final java.lang.String DataSourceClassName
public java.lang.Object getObjectInstance(java.lang.Object refObj, javax.naming.Name name, javax.naming.Context ctx, java.util.Hashtable<?,?> env) throws java.lang.Exception
getObjectInstance
in interface javax.naming.spi.ObjectFactory
java.lang.Exception
Copyright © 2000-2015 Apache Software Foundation. All Rights Reserved.