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 添付ファイル
127155 参照数
平均 (3 投票)
コメント 作成者 日時
Supongo que cuando la cuenta no es gmail... Javier Beringola 2008/12/28 9:06
Hi Guys, I am a having a peculiar problem.I was... Joe Veliyath 2011/06/29 1:42
Notice that if you are setting this up in... Jakub Liska 2011/11/18 17:15
Ouch, I pasted the example how it shouldn't... Jakub Liska 2011/11/20 9:36
I have set the mail session settings as... srijani basak 2012/07/18 6:02
Hi all I am trying it with 6.0.6 but it is not... Mittal Patoliya 2012/12/17 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.
投稿日時:08/12/28 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.
投稿日時:11/06/29 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.

投稿日時:11/11/18 17:15
Ouch, I pasted the example how it shouldn't look like by accident, this is correct :

Jakub Liskaへのコメント。投稿日時:11/11/20 9:36
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
Jakub Liskaへのコメント。投稿日時:12/07/18 6:02
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$
srijani basakへのコメント。投稿日時:12/12/17 5:17