3.15. Outgoing mail service

Warning

You are looking at documentation for an older release. Not what you want? See the current release documentation.

eXo Platform includes an email sending service that needs to be configured before it can function properly. This service, for instance, is used to send notifications of connection requests.

The service requires an external SMTP server that allows accounts to send email from applications. A suggestion is to use Google SMTP, as detailed below.

In configuration, you need to provide your account and password, and other information so that eXo Platform can connect to the SMTP server.

The configuration file exo.properties is as follows:

Here is the default configuration (it will not work of course, you will need to edit it):

# Email display in "from" field of emails sent by eXo platform.
exo.email.smtp.from=noreply@exoplatform.com
# SMTP Server hostname.
exo.email.smtp.host=localhost
# SMTP Server port.
exo.email.smtp.port=25
# True to enable the secure (TLS) SMTP. See RFC 3207.
exo.email.smtp.starttls.enable=false
# True to enable the SMTP authentication.
exo.email.smtp.auth=false
# Username to send for authentication. Sample: exo.email.smtp.username=account@gmail.com
exo.email.smtp.username=
# Password to send for authentication.
exo.email.smtp.password=
# Specify the port to connect to when using the specified socket factory. Sample: exo.email.smtp.socketFactory.port=465
exo.email.smtp.socketFactory.port=
# This class will be used to create SMTP sockets. Sample: exo.email.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory
exo.email.smtp.socketFactory.class=

Read the inline comments to understand each property. Here are some remarks:

Using Gmail as your SMTP server

Here is the sample using smtp.gmail.com server:

exo.email.smtp.from=noreply@exoplatform.com
exo.email.smtp.host=smtp.gmail.com
exo.email.smtp.port=465
exo.email.smtp.starttls.enable=true
exo.email.smtp.auth=true
exo.email.smtp.username=exo.test100@gmail.com
exo.email.smtp.password=***
exo.email.smtp.socketFactory.port=465
exo.email.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory

To make the configuration work, you need to:

Here is a checklist provided by Google to help you solve problem if any.

Besides, for securing your account, Google may block access from an app and send you an email to review the access. So in case the mail service does not work, check your inbox and get the link to allow the app access.

Note

In case of Gmail, exo.email.smtp.from must be a real account that you own. It does not need to be a Gmail account, as you can guess by the sample. You will configure your main account (that is exo.email.smtp.username) to add this from email as another "send as".

To do so, follow this guide of Google.

In case the from parameter is not valid, it does not fail the email sending and the main account will be displayed instead.

See also

Copyright ©. All rights reserved. eXo Platform SAS
blog comments powered byDisqus