Liferay DXP uses a mail server and SMTP to email notifications. Liferay DXP’s built-in mail session is the easiest way to configure mail and it’s recommended. You can configure the built-in mail session before or after deploying Liferay DXP. Alternatively, you can configure Liferay DXP to use a mail session on the application server.
Creating a mail session in Liferay DXP or on the application server requires this information:
- Incoming POP Server and port
- POP User Name
- POP Password
- Outgoing SMTP Server and port
- SMTP User Name
- SMTP Password
- All JavaMail properties you want to use
Built-in mail session setup is recommended and easiest.
The built-in mail session setup can be done using either of these methods:
After deploying Liferay DXP, you can configure the mail session from the Control Panel.
Sign in as the administrative user (the user you specified on the Basic Configuration page).
Navigate to Control Panel → Configuration → Server Administration → Mail.
Fill out the form. You’re asked for the following information:
Incoming POP Server: The hostname for a server running the Post Office Protocol. Liferay DXP checks this mailbox for incoming messages, such as message board replies.
Incoming Port: The port on which the POP server is listening.
Use a Secure Network Connection: Use an encrypted connection when connecting to the POP server.
User Name: The user ID Liferay DXP should use to log into the POP server.
Password: The password Liferay DXP should use to log into the POP server.
Outgoing SMTP Server: The hostname for a server running the Simple Mail Transfer Protocol. Liferay DXP uses this server to send emails, such as password change emails and other notifications.
Outgoing Port: The port on which the SMTP server is listening.
Use a Secure Network Connection: Use an encrypted connection when connecting to the SMTP server.
User Name: The user ID Liferay DXP should use to log into the SMTP server.
Password: The password Liferay DXP should use to log into the SMTP server.
Manually specify additional JavaMail properties to override the above configuration: If there are additional properties you need to specify, supply them here.
Liferay DXP connects to the mail session immediately.
If you prefer specifying your mail session offline or before deploying Liferay DXP, use portal properties.
portal-ext.propertiesfile, if you haven’t already created one.
Copy these default property settings into your
mail.session.mail=false mail.session.mail.pop3.host=localhost mail.session.mail.pop3.password= mail.session.mail.pop3.port=110 mail.session.mail.pop3.user= mail.session.mail.smtp.auth=false mail.session.mail.smtp.host=localhost mail.session.mail.smtp.password= mail.session.mail.smtp.port=25 mail.session.mail.smtp.user= mail.session.mail.store.protocol=pop3 mail.session.mail.transport.protocol=smtp
Replace the default mail session values with your own.
portal-ext.propertiesfile into your LIFERAY_HOME, once you’ve established it based on your installation.
Liferay DXP connects to the mail session on the next startup.
You can manage a mail session for Liferay DXP on your application server. Here’s how:
Create a mail session on your application server, following your application server documentation.
Point Liferay DXP to that mail session using the Control Panel or portal properties. Here are instructions for both:
Configure the JNDI name in the Mail page at Control Panel → Configuration → Server Administration → Mail.
mail.session.jndi.nameportal property in a
[LIFERAY_HOME]/portal-ext.propertiesfile. Here’s an example property:
Lastly, configure your instance’s email senders.
Email senders are the default name and email address Liferay DXP uses to send administrative emails and announcement emails.
Default email senders are configured in the
- Admin email configuration:
```properties admin.email.from.name=Joe Bloggs firstname.lastname@example.org ```
Announcements email configuration:
- Replace the names and email addresses above with your values.
- Restart your server.
Congratulations on configuring mail for Liferay DXP.