HOME - Recent Changes - Search:

Academic Work


Personal

* pot de départ


dblp


(:twitter:)

-----

[ edit | logout ]
[ help | sandbox | passwd ]

Configuring gmail smtp server with Liferay

#############################

Problem

You want to send e-mails from Liferay, for instance send a new password if the user forgot the old one.

Solution

The simplest way is to use a Gmail account for this purpose. This way you don't need to set up a mail server on your machine.

First, create a dedicated Gmail account. Under SettingsForwarding and POP/IMAP, you must enable POP and IMAP!

Then, if you use Liferay 5.2+, create the following file with this contents:

$LIFERAY/ROOT/WEB-INF/classes/portal-ext.properties :

mail.session.mail.store.protocol=imap
mail.session.mail.transport.protocol=smtp
#smtp properties
mail.session.mail.smtp.host=smtp.gmail.com
mail.session.mail.smtp.password=validpassword
mail.session.mail.smtp.user=validid@gmail.com

mail.session.mail.smtp.port=465
mail.session.mail.smtp.auth=true
mail.session.mail.smtp.starttls.enable=true
mail.session.mail.smtp.socketFactory.class=javax.net.ssl.SSLSocketFactory

#mail.session.mail.smtp.socketFactory.fallback=false
#mail.session.mail.smtp.socketFactory.port=465
# Other protocols mail.session.mail.imap.host=localhost
mail.session.mail.pop3.host=localhost

Then restart Tomcat. You don't need to put the values between quotes. For the username you must add @gmail.com too.

Note

It was not easy to figure all this out…

Links:

The file portal.properties is in portal-impl.jar. The file portal-ext.properties that we created above overwrites some values.

Cloud City


anime | bash | blogs | bsd | c/c++ | c64 | calc | comics | convert | cube | del.icio.us | digg | east | eBooks | egeszseg | elite | firefox | flash | fun | games | gimp | google | groovy | hardware | hit&run | howto | java | javascript | knife | lang | latex | liferay | linux | lovecraft | magyar | maths | movies | music | p2p | perl | pdf | photoshop | php | pmwiki | prog | python | radio | recept | rts | scala | scene | sci-fi | scripting | security | shell | space | súlyos | telephone | torrente | translate | ubuntu | vim | wallpapers | webutils | wikis | windows


Blogs and Dev.

* Ubuntu Incident
* Python Adventures
* me @ GitHub


Places

Debrecen | France | Hungary | Montreal | Nancy


Notes

full circle | km


Hobby Projects

* Jabba's Codes
* PmWiki
* Firefox
* PHP
* JavaScript
* Scriptorium
* Tutorials
* me @ GitHub


Quick Links


[ edit ]

View - Edit - History - Attach - Print *** Report - Recent Changes - Search
Page last modified on 2010 April 09, 00:29