• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 742
  • Last Modified:

Query Lotus Notes for number of Unread Mail in URL or Data Dump.

I need to display the number of unread emails a user has on a web page.

We have all see the Link for mail and then a (4) behind it meaning there are 4 unread emails in the account.

The email server is lotus. Is there a way i could provide the username and password from the user to a lotus database and get the number of unread emails back? Maybe in a url?

Another option would be to query lotus database every couple of minutes and dump the data into an sql database that i would then query with the web page. For instance, could i creat a table from lotus that lists the username along with the number of unread messages? If so i could make the web page query this table.
0
jennifer_merritt
Asked:
jennifer_merritt
  • 9
  • 7
  • 6
1 Solution
 
Sjef BosmanGroupware ConsultantCommented:
Seems a rather crude approach to me: dump a database, create a table, etc. Did you know that a Domino server is a web server, so why all the indirect queries? Develop your web pages in Domino, I'd say. And why don't you use iNotes??

What Domino release is the server?
0
 
jennifer_merrittAuthor Commented:
I am running 8.5 domino.
I just need a page that will display one number...the number of unread emails. I just need to get this number and then i can complete the other page that i need to create.

The page shows a couple of application links with the number of actions that need to be taken....ie:

You have (4) unread emails.
You have (24) documents to sign.
You have (1) deficiency.

I would like to be able to pass a username and then get back the email number.
0
 
jennifer_merrittAuthor Commented:
I am using inotes actually. the link is to inotes. but i need to show them how many unread emails they have on the link...if that makes any sence?
 
The link to inotes is single sign on.
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Bill-HansonCommented:
It sounds like you're making a dashboard.

Although there is no simple URL command that will return the unread count for a specific user, you can create a web service (or just a simple agent) that can return this info to your page using AJAX.

Here's an example of a simple agent that can be called via AJAX. Just remember that unread marks are stored per user, so the code that makes this AJAX call needs to be run as the logged in user.

Dim session As New NotesSession
Dim db As NotesDatabase
Dim view As NotesView
Dim vc As NotesViewEntryCollection
Set db = session.CurrentDatabase
Set view = db.GetView("($Inbox)")
Set vc = view.GetAllUnreadEntries()
Print vc.Count

Open in new window

0
 
jennifer_merrittAuthor Commented:
is there a way that i could pass the username and be returned a number of unread mails? This has to happen on a web page. I could use an iframe.
I don't want to authenticate each user to get this one number.

Is there a way that i could use my crude way of getting this information? Can i get a dump from lotus showing a username and a number of unread emails. If i could get that dumped every couple of minutes, i would be able to query that table.

Does lotus domino provide a scheduled task that would allow it to be queried by a SQL server by chance?

I know it is not a nice idea, but it is the only solution i see that would not involve logging in a user in order to get one number(being the unread emails).
0
 
Bill-HansonCommented:
The only problem you have is that the user must be authenticated.  I know of no other workaround.  Once the user is authenticated, then retrieving the count is trivial.
0
 
Sjef BosmanGroupware ConsultantCommented:
Agreed, 100%. Some explanation: the unread count is per person, so if someone else would check my mail database he'd get a different number.
0
 
jennifer_merrittAuthor Commented:
Could i explore the possibility of outputting a table (in some format) that will show each users username and the number of unread emails?
0
 
Sjef BosmanGroupware ConsultantCommented:
AFAIK not possible.
0
 
Bill-HansonCommented:
Not possible unless you had all user names and password stored un-encrypted on the server.  Then you might be able to use HTTP POST to authenticate the user programatically and retrieve the count.  Of course, then you have the problem of storing, maintaining and securing a database that might present a security vulnerability.  Again, there's no way to get the count without authenticating the user.
0
 
jennifer_merrittAuthor Commented:
How would i go about authenticating the user and retrieving the number. I know how to authenticate via a http-post. But what would i do after authenticating in order to get the number back?
0
 
Bill-HansonCommented:
You would redirect to the agent or web service that returns the count.

The code is posted above (#36932149).  Place it in an agent that runs as the web user (security tab of agent properties).  If you use this agent as is, you will need to place it in each user's mail file.  Another option is to put the agent in a central location, and open the current user's email explicitly.
0
 
Sjef BosmanGroupware ConsultantCommented:
If it's single sign-on, the user is authenticated, so the number for the unread messages should be correct when their mail database is inspected.

AFAIK there is no call that produces the number you want. I suppose all you can do is something like this:
- create an Outline
- create one entry called ($Inbox)
- put that on a page
- execute an ajax-request to fetch that page, search for the number, and output the number
0
 
Sjef BosmanGroupware ConsultantCommented:
Or he code above ... :$
0
 
Sjef BosmanGroupware ConsultantCommented:
Eh? Does that work indeed??
0
 
jennifer_merrittAuthor Commented:
I haven't tried it, but have decided to reach out to a consultant to assist with this project. I hope to get a resolution that way.

Thank you for all your help.
0
 
Bill-HansonCommented:
RE:"Eh? Does that work indeed??"

Yep!  Anything printed in a web agent gets sent back to the browser.  This is how I provided web services in Domino before Lotus officially supported it.  I use this technique often to generate dynamic content for web apps at run time.  For the agent above, all you would need to do is check the value of responseText.  The only hard part about this question is the authentication.
0
 
Sjef BosmanGroupware ConsultantCommented:
Eh, Bill, that question was for Jennifer, regarding my suggestion to use an Outline in a Page. I was (and am still) rather surprised to be the sole beneficiary of the points awarded in this question, which seems not entirely fair to me.

@JM: maybe it's a suggestion to have the question reopened, and then we wait till you can publish the hired consultant's advice, so you can rightfully (re)award the points.
0
 
Bill-HansonCommented:
RE:"rather surprised"

Me too, but no worries.  As I've said many times, I don't do this for the points. In this case, the question is marked as answered with a 'Good' rating, but the answer is untested, still requires the user to authenticate, and will perform slower than my solution. Such is life.  ;)
0
 
Sjef BosmanGroupware ConsultantCommented:
No worries here, just amazed, and uncomfortable with the wrongly attributed credits (not points).
0
 
jennifer_merrittAuthor Commented:
I am not quite sure how to unclose a question. I wasn't expecting to have a discussion about points. Just thought some posts were more inline with what i wanted to do.
0
 
Sjef BosmanGroupware ConsultantCommented:
No problem, it is not really a points discussion. I was just wondering whether the best answer to your question was indeed the one you accepted, for Bill's code does a similar thing in a more modern and definitely shorter way. It's all up to you!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

  • 9
  • 7
  • 6
Tackle projects and never again get stuck behind a technical roadblock.
Join Now