How to configure/use outlook mail server to send email notifications in Liferay

Issue

  • While configuring outlook mail through Liferay mail configuration the below exception is thrown :

    " Could not connect to SMTP host: smtp.office365.com, port: 587" 
    OR
    ERROR [liferay/mail-1][MailEngine:128] Unable to send message: Exception reading response
    javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?

Environment

  • Liferay DXP 7.0
  • Liferay DXP 7.1
  • Liferay DXP 7.2

Resolution

  • To configure outlook SMTP, follow the below steps
    • Add the following properties in portal-ext.properties,

      mail.session.mail.smtp.auth=true
      mail.session.mail.smtp.starttls.enable=true​

    • Restart the server, navigate to Control Panel-> Configuration-> Server Administration -> Mail-> Added the values for Outgoing SMTP Server (Attached Screenshot for reference).
      Outgoing SMTP Server : smtp.office365.com
      Outgoing Port : 587
      Use a Secure Network Connection : Uncheck

      Provide the outlook credentials
      SMTP.png
    • Test the email notification.

Additional Information

Was this article helpful?
1 out of 2 found this helpful