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 is as follows (see Configuration overview if the file has not been created yet):
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. email@example.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: firstname.lastname@example.org 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:
You need to provide SMTP server host/port, a username/password to be authenticated by that server. Others are optional.
Typically, administrators want to mask the From field in the system emails with something like
email@example.com so that the receivers recognize it is robotic.
Many SMTP services allow you to set From field in outgoing emails to another email address
than the authenticated account. That's why here you see the property
If this parameter is not valid, the value of
exo.email.smtp.username will be used instead.
If you want to use SMTP gateway over SSL, configure a certificate truststore containing your SMTP server's public certificate. Depending on the key sizes, you may then also need to install Java Cryptography Extension (JCE) Unlimited Strength Jurisdiction Policy Files for your Java Runtime Environment.
Using Gmail as your SMTP server
Here is the sample using smtp.gmail.com server:
firstname.lastname@example.org exo.email.smtp.host=smtp.gmail.com exo.email.smtp.port=465 exo.email.smtp.starttls.enable=true exo.email.smtp.auth=true email@example.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:
Register a Google account that is firstname.lastname@example.org in the sample.
Enable POP and IMAP for that account. This can be done simply in your Gmail settings, see the screenshot below.
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.
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.