Your message has been sent.
This article has been saved to your account.
Go to my account
This article has been emailed to your Kindle.
Send this article
Complete the form below to send this article, Liferay Mail and SMS Text Messenger Portlet, to a friend (or to yourself). We will never share your details (or your friend's) with anyone. For more information, read our Privacy Policy.
As an administrator of an intranet website, you are required to provide an environment for employees to enjoy mailing, SMS text messaging with others. In this article by Jonas X. Yuan, we will discuss how to manage emails and then focus on SMS text messenger.
In this article we will learn how to:
- Manage (check, delete, forward, reply, search) mails.
- Set up mail portlet.
- Manage SMS text messenger portlet.
Working with Mail Portlet
For the purpose of this article, we will use an intranet website called book.com which is created for a fictions company named "Palm Tree Publications".
In order to let employees manage their emails, we can use the Liferay Mail portlet. As an administrator of "Palm Tree Publications", you need to create a Page called "Mail" under the Page, "Community" at the Book Lovers Community Public Pages and also add the Mail portlet in the Page, "Mail".
Experiencing Mail Management
First of all, login as "Palm Tree". Then, let's do the above as follows:
- Add a Page called "Mail" under the Page "Community" at the Book Lovers Community Public Pages, if the Page is not already present.
- If the Mail portlet is not already present, add it in the Page, "Mail" of the Book Lovers Community where you want to manage mails. You will see the Mail portlet as shown in the following figure.

Let's assume that we set up the mail domain as "cignex.com" in the Enterprise Admin portlet for testing purposes, as we have a mail engine with this mail domain already. Of course, you could set up the mail domain as "book.com", or something else, if you had a mail engine with this mail domain in your hand.
As an editor of the editorial department, "Lotti Stein", you may want to manage your mails in the mail domain, "cignex.com". You can first choose a user name for your personal company the email address, say "admin1234" and register. Let's do it as follows:
- Login as "Lotti Stein".
- Go to the Page "Mail" under the Page, "Community", at the Book Lovers community Public Pages.
- Locate the Mail portlet.
- Input the value for User name as "admin1234".
- Click the Register button.
Your new email address is "admin1234@cignex.com". This email address will also serve as your login, as shown in the following figure.

You can now check for new messages in your inbox, by clicking the Inbox link first. Then, you can view the Unread messages, and either Check Mail or create a New mail, as shown in the following figure:

You can go to the Page of Mail management by clicking on any link of Unread Messages, or Check Mail button or New button. Further, you can manage emails through the Mail portlet of your current account. Email management includes the following features (as shown in the following figure):
- Create a New email.
- Check Mail.
- Reply to an email.
- Reply All emails.
- Forward emails.
- Delete emails.
- Print emails, and
- Search.

Note that the first email with the subject, "Users in Staging server", is sent through the SMS Text Messenger portlet. For more details, refer to the forthcoming section.
How to Set up Mail Server?
In order to make the Mail portlet work, we have to set up a mail server with IMAP, POP and SMTP protocols. Suppose that the Enterprise "Palm Tree Publications" has a mail server with the domain "exg3.exghost.com", an account "admin@cignex.com/admin1234", and protocol IMAP, POP and SMTP. As an administrator, you need to integrate this mail server with IMAP, POP and SMTP protocol in Liferay. Let's do it as follows:
- Find the file ROOT.xml in $TOMCAT_DIR/conf/Catalina/localhost.
- Find the mail configuration first.
- Then configure it as follows:
<!-- Mail -->
<Resource
name="mail/MailSession"
auth="Container"
type="javax.mail.Session"
mail.imap.host="exg3.exghost.com"
mail.imap.port="143"
mail.pop.host="exg3.exghost.com"
mail.pop.port="110"
mail.store.protocol="imap"
mail.transport.protocol="smtp"
mail.smtp.host="exg3.exghost.com"
mail.smtp.port="2525"
mail.smtp.auth="true"
mail.smtp.starttls.enable="true"
mail.smtp.user="admin@cignex.com"
password="admin1234"
mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"
/>
In short, a Mail portlet is an AJAX web-mail client. We can configure it to work with any mail server. It reduces page refreshes, since it displays message previews and message lists in a dual pane window.
How to Set up Mail Portlet?
If you have proper Permissions, you can change the preferences of the Mail portlet. To change the preferences, you can simply click the Preferences icon to the upper right of the Mail portlet.
With the Recipients tab selected, you can find potential recipients from the Directory (Enabled or Disabled) and the Organization (My Organization or All Available). Click the Save button after making any changes.
Using the Filters tab, you can set the values to filter emails associated with an email address to a Folder. Click the Save button after making any changes.
Note that the maximum number of email addresses is ten. This number is also configurable at the portal-ext.properties
Similarly, the Forward Address tab allows all emails to be forwarded to the email address you want. Enter one email address Per Line. Remove all entries to disable email forwarding. Select Yes to leave, or No to not leave a copy of the forwarded message. Click the Save button after making any changes.
Further, the Signature tab also allows you to set up your signature using HTML text editor. The signature you have set up will be added to each outgoing message. Click the Save button after making any changes.
The Vacation Message tab allows you to set up vacation messages using HTML text editor. The vacation message notifies others of your absence (as shown in the following figure). Click the Save button after making any changes.

Using Permissions
The following table shows Permissions for the Mail portlet. A Community User can set up all Permissions (marked ‘X') while a Guest User has the View, Configuration and Preferences Permissions. By default, a Community (marked ‘*') as well as a Guest User has View action.
|
Action |
Description |
Community |
Guest |
|
View |
Views this portlet |
X, * |
X, * |
|
Configuration |
Configures Permissions of this portlet |
X |
X |
|
Preferences |
Configures mail setting of this portlet |
X |
X |
Obviously, as a User of the Book Lovers Community, "Lotti Stein" has only View Permissions on the Mail portlet, by default. Since the Book Lovers community has no Permission "Preferences", it follows that "Lotti Stein" too has no "Preferences" Permission.
As an administrator, you may need to set up the Community Users having Permissions, Preference as well as View, on the Mail portlet. Thus, the Community User can set up mail settings. That is, you need to add Permissions (Preference) on the Mail portlet at the Book Lovers community. Let's do it as follows (see the following figure):
- Click on the Configuration icon to the top right of the Mail portlet.
- Then click on the Permissions tab.
- Select the Community tab.
- Select Permission, Preferences, in the Available box.
- Click on the Add arrow, and
- Click on the Save button if you are ready.

Using Mail Portlet effectively
Liferay Portal can integrate with Washington IMAP + Sendmail, Cyrus IMAP + Postfix, and Dovecot + Postfix, as well as with Microsoft Exchange and other IMAP servers. As stated above, the mail server "exg3.exghost.com" is Microsoft Exchange server.
You can access your email through an IMAP server. If access is on IMAP, the portal does not have to know where to persist the mail.
IMAP stands for Internet Message Access Protocol. URL: http://www.imap.org/.
One of the popular protocols used for email is IMAP, an application layer Internet protocol. IMAP operates on port 143 that allows a local client to access email on a remote server.
IMAP supports both connected and disconnected modes of operation. Until the User explicitly deletes them, email IMAP clients generally leave messages on the server. Moreover, IMAP offers access to the mail store.
IMAP has a lot of advantages. Here, we have listed just some of them:
- Use connected and disconnected modes of operation.
- Users can connect to the same mailbox simultaneously.
- Users have access to MIME message parts and partial fetch.
- Has message state information.
- Supports multiple mailboxes on the server.
- Provides ability for search on the server-side.
- Has a built-in extension mechanism.
Working with SMS Text Messenger
In order to let employees send text message to others, anytime, we can use the Liferay SMS Text Messenger portlet. As an administrator of "Palm Tree Publications", you need to create a Page called "SMS" under the Page "Community" at the Book Lovers Community and add the SMS Text Messenger portlet in the Page, "SMS".
Using SMS Text Messenger
First of all, login as "Palm Tree". Then, let's do the above action as follows:
- Add a Page called "SMS" under the Page "Community" at the Book Lovers Community Public Pages, if the Page is not already present.
- Add the SMS Text Messenger portlet in the Page, "SMS" of the Book Lovers Community where you want to set up SMS Text Messenger (if this portlet is not already present). You will see the SMS Text Messenger portlet as shown in the following figure:

As an editor of the editorial department, "Lotti Stein" wants to send a Message, say "Users in Staging server", to a person, say "admin@cignex.com". Let's do it as follows:
- Login as "Lotti Stein".
- Go to the Page "SMS" under the Page "Community" at the Book Lovers community Public Page.
- Locate the SMS Text Messenger.
- Input value for To as "admin@cignex.com", Subject as "Users in Staging server" and a Message.
- Click the Send Text Message button.
The User "admin@cignex.com" will receive this email sooner or later, as we have described in the previous section.

How to Set up SMTP?
In order to make SMS Text Messenger work well, we have to set up the mail server with SMTP protocol. Suppose that the Enterprise "Palm Tree Publications" has a mail server with a domain "smtp.gmail.com", an account "jonasxyuan/jonas1234", and a protocol, SMTP. As an administrator, you need to integrate this mail server with SMTP protocol in Liferay. Let's do it as follows:
- Find the file ROOT.xml in $TOMCAT_DIR/conf/Catalina/localhost.
- Find the mail configuration first.
- Then, configure it as follows:
<Resource
name="mail/MailSession"
auth="Container"
type="javax.mail.Session"
mail.imap.host="smtp.gmail.com"
mail.pop.host="smtp.gmail.com"
mail.store.protocol="imap"
mail.transport.protocol="smtp"
mail.smtp.host="smtp.gmail.com"
mail.smtp.port="465"
mail.smtp.auth="true"
mail.smtp.starttls.enable="true"
mail.smtp.user="jonasxyuan"
password="jonas123456"
mail.smtp.socketFactory.class="javax.net.ssl.SSLSocketFactory"
/>
In short, the SMS Text Messenger portlet allows you to send SMS text messages from your portal page anytime.
Using SMS Effectively
The Short Message Service (SMS), called text messaging, is used to send short messages to and from mobile phones. It provides a mechanism for the delivery of short text messages over mobile networks, in order to transmit messages to and from mobiles. The text message from the sender can be stored in a central short message center, which then forwards it to the recipient. If the recipient is not available, the short message is stored temporally and will be sent later. SMS provides return receipts. Thus, the sender gets a brief message notification if the short message is delivered to the recipient.
You may need to read the following part, if you are interested in the organization of network elements for supporting SMS. Otherwise, you can leave it for your future needs. The following figure shows a typical organization of network elements in a network supporting SMS (refer to more details at http://www.wirelessdevnet.com/channels/sms/features/sms.html).

The SMC (Short Message Center) stores and forwards messages, to and from the message station. The SME (Short Message Entity) receives and sends short messages.
The SMS GWMS (SMS gateway MSC), a gateway MSC, can receive short messages. After receiving the short message from the message center, GMSC employs the SS7 (Signaling System #7) network to interrogate the current position of the mobile station from the HLR (home location register).
HLR, as a main database, holds information about the subscription profile of the mobile. It also maintains the routing information for the subscriber where the mobile is currently situated. The GMSC thus passes on the short message to the correct MSC.
MSC (Mobile Switching Center) switches connections between mobile stations.
A VLR (Visitor Location Register) communicates with each MSC and contains temporary information about the mobile. MSC switches the short message to the corresponding BSS (Base Station System), which transmits the short message to the mobile. The BSS is made up of transceivers, which send and receive information over the air interface, to and from the mobile station. The short message is passed over signaling channels, so that the recipient (for example, mobile) can receive this short piece of information, even if a data call or a voice call is going on.
Summary
In this article we discussed how to manage (check, delete, add, reply, forward, search) emails and also to set up the Mail portlet properly. Finally, we discussed how to manage the SMS Text Messenger portlet and send SMS text messages.
About the Author :
Jonas X. Yuan
Dr. Yuan is an expert on Liferay Portal and Content Management Systems (CMS). As an open source community contributor, he had published three Liferay books from 2008 to 2010. He is also an expert on Liferay integration with Ad Server OpenX, different search engines, enterprise content types including videos, audios, images, documents, and web contents, and other technologies such as BPM Intalio and Business Intelligence Pentaho, LDAP, and SSO. He holds a Ph.D. in Computer Science from the University of Zurich, where he focused on Integrity Control in Federated Database Systems. He earned his M.S. and B.S. degrees from China, where he conducted research on expert systems for predicting landslides. Previously, he worked as a Project Manager and a Technical Architect in Web GIS (Geographic Information System). He is experienced in SystemsDevelopment Lifecycle (SDLC) and has deep, hands-on, skills in J2EE technologies. He developed a BPEL (Business Process Execution Language) Engine called BPELPower from scratch in NASA data center. As the chief architect, Dr. Yuan led and successfully launched several large scale Liferay/Alfresco projects for millions of users each month.
Books From Packt



Post new comment