Activating Mail Transport on the Server Side
1. Go to the Software AG_directory /profiles/CTP/workspace/wsstack/repository/conf directory and open the axis2.xml file.
2. Find the contextRoot parameter. If it is commented out, uncomment it and make sure its value is wsstack:
<parameter name="contextRoot" locked="false">wsstack</parameter>
3. Uncomment the sections that define the transport receiver and the transport sender with name=“mailto”:
<transportReceiver name="mailto" … />
<transportSender name="mailto" … />
The parameters under the transport receiver and the transport sender have default values; verify these values.
4. Set the values on the required parameters for the transport receiver.
The following table shows the available parameters.
Parameter | Description |
mail.pop3.host | Host name (or IP address) for the machine that hosts the James mail server. If the server is running on the same machine as Web Services Stack, you can set the value to “If the server is running on the same machine as Web Services Stack, you can set the value to "localhost" or "127.0.0.1". |
mail.pop3.user | User name of a user registered in the James mail server. |
transport. mail.pop3. password | Password for the specified user name. |
mail.store. protocol | Value must be "pop3". |
transport.mail. replyTo Address | Supplies the endpoint reference for the response and represents the server email address. Contains the user name specified in the mail.pop3.user parameter and the server name of the James mail server, separated by the @ sign. The server name is configured in the JAMES_HOME/apps/james/SAR-INF/config.xml configuration file. If you have not specified a different one, the initial value is "localhost". |
transport. listener.interval | Interval, in milliseconds, at which to check the mail server for new messages. If you do not specify a value, the default is 3000 milliseconds. |
Below is sample code that shows the usage of the required parameters for the transport receiver.
<transportReceiver name="mailto" class="org.apache.axis2.transport.mail.SimpleMailListener">
<parameter name="mail.pop3.host">localhost</parameter>
<parameter name="mail.pop3.user">server</parameter>
<parameter name="transport.mail.pop3.password">wsstack</parameter>
<parameter name="mail.store.protocol">pop3</parameter>
<parameter name="transport.mail.replyToAddress">server@localhost</parameter>
<parameter name="transport.listener.interval">3000</parameter>
</transportReceiver>
5. Set the values on the required parameters for the transport sender.
The following table shows the available parameters.
Parameter | Description |
mail.smtp.host | Host name (or IP address) for the machine that hosts the James mail server. The value corresponds to the mail.pop3.host parameter under the transport receiver. |
mail.smtp.user | Corresponds to the value of the mail.pop3.user parameter of the transport receiver. |
transport.mail. smtp.password | Corresponds to the value of the transport.mail.pop3.password parameter of the transport receiver. |
mail.smtp.from | Corresponds to the value of the mail.transport.replyToAddress parameter of the transport receiver. |
Below is sample code that shows the usage of the required parameters for the transport sender.
<transportSender name="mailto" class="org.apache.axis2.transport.mail.
MailTransportSender">
<parameter name="mail.smtp.host" locked="false">localhost</parameter>
<parameter name="mail.smtp.user">server</parameter>
<parameter name="transport.mail.smtp.password">wsstack</parameter>
<parameter name="mail.smtp.from">server@localhost</parameter>
</transportSender>