Alternative Email Configuration Methods
There are several methods of configuring Liferay DXP to connect to a mail server. The simplest way to get started is to configure mail using through the Server Administration UI. This article covers alternative methods for configuring mail; Using Portal Properties or using an application server’s mail session.
Configuring the Built-in Mail Session Using Portal Properties
To configure the mail session offline or before deploying DXP:
-
Create a
portal-ext.properties
file (if the file does not already exist). -
Copy these default property settings into the
portal-ext.properties
file:mail.session.mail=false mail.session.mail.pop3.host=pop.gmail.com mail.session.mail.pop3.password=******* mail.session.mail.pop3.port=110 mail.session.mail.pop3.user=joe.bloggs mail.session.mail.smtp.auth=true mail.session.mail.smtp.host=smtp.gmail.com mail.session.mail.smtp.password=******* mail.session.mail.smtp.port=465 mail.session.mail.smtp.user=joe.bloggs mail.session.mail.store.protocol=pop3 mail.session.mail.transport.protocol=smtp
-
Replace the default mail session values with your own.
-
Put the
portal-ext.properties
file into the Liferay Home.
DXP connects to the mail session on the next startup.
Connecting to a Mail Session on the Application Server
Users can opt to configure a mail session for DXP using their application server.
-
Create a mail session on your application server; please see the application server’s documentation.
-
If using the Control Panel, navigate to Control Panel → Configuration → Server Administration → Mail.
-
Enter the value in the JavaMail Properties field.
-
Click Save. This points DXP to the mail session on your application server.
The mail server has been connected to DXP and ready to send notifications.
Setting the following property in portal-ext.properties and restarting your server will have the same effect as setting the value in the Control Panel: mail.session.jndi.name=mail/MailSession