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 Anhänge
130759 Angesehen
Durchschnitt (3 Stimmen)
Die durchschnittliche Bewertung ist 4.33333333333333 von max. 5 Sternen.
Antworten im Thread Autor Datum
Supongo que cuando la cuenta no es gmail... Javier Beringola 28. Dezember 2008 09:06
Hi Guys, I am a having a peculiar problem.I was... Joe Veliyath 29. Juni 2011 01:42
Notice that if you are setting this up in... Jakub Liska 18. November 2011 17:15
Ouch, I pasted the example how it shouldn't... Jakub Liska 20. November 2011 09:36
I have set the mail session settings as... srijani basak 18. Juli 2012 06:02
Hi all I am trying it with 6.0.6 but it is not... Mittal Patoliya 17. Dezember 2012 05: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.
Gepostet am 28.12.08 09: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.
Gepostet am 29.06.11 01: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.

Gepostet am 18.11.11 17:15.
Ouch, I pasted the example how it shouldn't look like by accident, this is correct :

Gepostet am 20.11.11 09:36 als Antwort auf 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
Gepostet am 18.07.12 06:02 als Antwort auf 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$
Gepostet am 17.12.12 05:17 als Antwort auf srijani basak.