Can be configured in the Context scope of your server.xml configuration file.
Example:
<Resource name="mail/send" auth="CONTAINER"
type="jakarta.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>[email protected]</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 static final String |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public Object | getObjectInstance(Object
The possibly null object containing location or reference
information that can be used in creating an object. refObj, Name The name of this object relative to name, Context nameCtx,
or null if no name is specified.The context relative to which the ctx, Hashtable<?, ?> name
parameter is specified, or null if name is
relative to the default initial context.The possibly null environment that is used in
creating the object. env)Implements javax. Creates an object using the location or reference information specified. |
| DataSourceClassName | back to summary |
|---|---|
| protected static final String DataSourceClassName | |
| SendMailFactory | back to summary |
|---|---|
| public SendMailFactory() | |
| getObjectInstance | back to summary |
|---|---|
| public Object getObjectInstance(Object refObj, Name name, Context ctx, Hashtable<?, ?> env) throws Exception Implements javax. Doc from javax. Creates an object using the location or reference information specified.
Special requirements of this object are supplied
using
A URL context factory is a special ObjectFactory that
creates contexts for resolving URLs or objects whose locations
are specified by URLs. The
The
Name and Context Parameters.
The
| |