Introduction #

This article is about setting up your SMTP server in Liferay. The example is done using a 3rd-party email account. For example, you can use your gmail account to send all notifications that come from your Liferay instance. This includes notifications from blog comments, message boards, and account registration emails.

Graphical User Interface #

In Liferay 6 and Liferay 5.2.x, you can configure the SMTP server by going to Control Panel -> Server Administration -> Mail.

Fill out the SMTP fields with your information: we will use gmail for simplicity. This is actually an easy and reliable way to run your SMTP server.

SMTP Server:
Port: 465
[x] Use Secure Connection  << check the box
User: Your gmail username
Password: Your gmail password 

This will give you a working SMTP server!

Legacy #

In older Liferay versions, there was no Liferay GUI. You had to set this based on your app server.

Apache Tomcat #

This section shows how to configure the SMTP server with an email address in Apache Tomcat.

In the file: $LP/conf/Catalina/localhost/ROOT.xml

<!-- Mail -->

<Resource name="mail/MailSession" auth="Container" type="javax.mail.Session""localhost""localhost""localhost""imap" mail.transport.protocol="smtp" />}}}

If you are using a Gmail account you should do the following:

0 Allegati
122994 Visualizzazioni
Media (3 Voti)
La media del punteggio è 4.33333333333333 stelle su 5.
Commenti Autore Data
Supongo que cuando la cuenta no es gmail... Javier Beringola 28 dicembre 2008 9.06
Hi Guys, I am a having a peculiar problem.I was... Joe Veliyath 29 giugno 2011 1.42
Notice that if you are setting this up in... Jakub Liska 18 novembre 2011 17.15
Ouch, I pasted the example how it shouldn't... Jakub Liska 20 novembre 2011 9.36
I have set the mail session settings as... srijani basak 18 luglio 2012 6.02
Hi all I am trying it with 6.0.6 but it is not... Mittal Patoliya 17 dicembre 2012 5.17

Supongo que cuando la cuenta no es gmail también habrá que especificar el nombre de usuario y contraseña para poder entrar en el servidor y envíe el correo.
Inviato il 28/12/08 9.06.
Hi Guys, I am a having a peculiar problem.I was trying out TABS of JQUERY in liferay. I build a new portlet to get this functionality. The good news was that the TABS worked when i added the portlet.But When i refresh the page,its not working. Why is that happening ?

P.S I have used the same example as in JQUERY tabs DEMO.
Inviato il 29/06/11 1.42.
Notice that if you are setting this up in instead of server administration, you must use secure smtp protocol : smtps . It is necessary for it to work with gmail.

Inviato il 18/11/11 17.15.
Ouch, I pasted the example how it shouldn't look like by accident, this is correct :

Inviato il 20/11/11 9.36 in risposta a Jakub Liska.
I have set the mail session settings as following:
Server :
Protocol: SMTP
Password: password
Verify Password: password

and added the following custom properties: :
mail.smtp.auth : true
mail.debug : true
mail.smtp.port: 465
mail.smtp.socketFactory.port: 465
mail.smtp.socketFactory.fallback false

But still I get the exception : setSessionResource Unable to connect to JavaMail session. The Mail host is either down, or it has not been properly setup. You will be unable to send personalized e-mail.

In MailProvider, I have these Protocol Providers:

imap com.sun.mail.imap.IMAPStore STORE
imaps com.sun.mail.imap.IMAPSSLStore STORE
pop3 com.sun.mail.pop3.POP3Store STORE
pop3s com.sun.mail.pop3.POP3SSLStore STORE
smtp com.sun.mail.smtp.SMTPTransport TRANSPORT
smtps com.sun.mail.smtp.SMTPSSLTransport
Inviato il 18/07/12 6.02 in risposta a Jakub Liska.
Hi all
I am trying it with 6.0.6 but it is not accepting as host.
Showing exception as follow.
11:45:19,801 ERROR [MailEngine:489] Unknown SMTP host:
11:45:19,801 ERROR [MailEngine:154]
at com.sun.mail.util.SocketFetcher.createSocket(
at com.sun.mail.util.SocketFetcher.getSocket(
at com.sun.mail.smtp.SMTPTransport.openServer(
at com.sun.mail.smtp.SMTPTransport.protocolConnect(
at javax.mail.Service.connect(
at com.liferay.util.mail.MailEngine._send(
at com.liferay.util.mail.MailEngine.send(
at com.liferay.util.mail.MailEngine.send(
at com.liferay.mail.messaging.MailMessageListener.doMailMessage(MailMessageListener­.java:101)
at com.liferay.mail.messaging.MailMessageListener.doReceive(MailMessageListener.jav­a:115)
at com.liferay.mail.messaging.MailMessageListener.receive(­43)
at com.liferay.portal.kernel.messaging.InvokerMessageListener.receive(InvokerMessag­
at com.liferay.portal.kernel.messaging.ParallelDestination$­
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(­86)
at java.util.concurrent.ThreadPoolExecutor$
Inviato il 17/12/12 5.17 in risposta a srijani basak.