Java Reference
In-Depth Information
2. In a text editor, open
setup/glassfish-resources.xml
and enter the
configuration settings for your SMTPS server.
The SMTPS server host name is set in the
host
attribute, email address from
which you want the message sent is the
from
attribute, the SMTPS user name is
the
user
attribute. Set the
mail-smtps-password
property value to the pass-
word for the SMTPS server user. The following code snippet shows an example
resource configuration. Lines in bold need to be modified.
<resources>
<mail-resource debug="false"
enabled="true"
from="user@example.com"
host="smtp.example.com"
jndi-name="mail/myExampleSession"
object-type="user" store-protocol="imap"
store-protocol-class="com.sun.mail.imap.IMAPStore"
transport-protocol="smtps"
transport-protocol-
class="com.sun.mail.smtp.SMTPSSLTransport"
user="user@example.com"
>
<description/>
<property name="mail-smtps-auth" value="true"/>
<property name="mail-smtps-password"
value="mypassword"/>
</mail-resource>
</resources>
3. Enter the following command:
ant all
This will compile, assemble, and deploy the application, and start a web browser
at the following URL:
http://localhost:8080/async
.
Note
If your build system isn't configured to automatically open a web
browser, open the above URL in a browser window.
4. In the web browser window, enter the email to which you want the test mes-
sage sent and click Send email.