0

I just recently installed WAS Liberty 8.5.5.7 as I am doing a conversion to Liberty for a projected presently deployed and configured for a GlassFish 4 environment.

The glassfish project, has a <mail-resource> configured within its domain configuration which the application utilizes to send out outgoing emails.

I was hoping the WAS Liberty supported such a configuration, can anyone clarify as I have not found any such documentation?

Sotirios Delimanolis
  • 274,122
  • 60
  • 696
  • 724
Sergio
  • 95
  • 9

2 Answers2

1

WAS Liberty 8.5.5.6 included full support for Java EE7 (including JavaMail 1.5).

There is no <mail-resource> element in WAS Liberty (it's probably some Glassfish specific config element that is not spec-standard).

Instead, you can configure javaMail like this once you enable the javaMail-1.5 feature:

<mailSession    mailSessionID="examplePop3MailSession"  
        jndiName="ExampleApp/POP3Servlet/exampleMailSession"
        description="POP3 javax.mail.Session"
        storeProtocol="pop3"
        transportProtocol="smtp"
        host="exampleserver.com"
        user="iamanexample@example.com"
        password="example"
        from="smtp@testserver.com">
     <property name="mail.pop3.host" value="pop3.example.com" />
     <property name="mail.pop3.port" value="3110" />
</mailSession>

See official documentation from IBM on configuring Java Mail 1.5.

Andy Guibert
  • 41,446
  • 8
  • 38
  • 61
  • Thank-you so much aguibert ... may I ask .. also in the same line of questioning ... does WAS Liberty have an equivalent configuration for and as I have such configurations in my current glassfish server and need to convert them into the WAS Liberty environment? Thank-you kindly – Sergio Nov 17 '15 at 18:25
  • 1
    The `` is a config element defined by the Java EE spec, so yes Liberty supports this. For `` you can set those instead using the `server.env` file (for details see https://www-01.ibm.com/support/knowledgecenter/was_beta_liberty/com.ibm.websphere.wlp.nd.multiplatform.doc/ae/twlp_admin_customvars.html). – Andy Guibert Nov 17 '15 at 19:52
  • I have yet to fully get this to work, but once I do I will update for certain. – Sergio Nov 19 '15 at 20:46
0

You can also check IBM WebSphere Application Server Liberty Profile Guide for Developers. In chapter 5 you will find sample application and step by step configuration how to use mail session with Liberty.

Gas
  • 17,601
  • 4
  • 46
  • 93