Solved

Accessing Mail files via webpage

Posted on 2000-05-08
4
187 Views
Last Modified: 2013-12-18
I want a link on our web page that takes people directly to their own respective mail account/database.

I have already made it so they have to logon before they get to the web page, what I don't know how to do, is the part that sees who they are and sends them to their email account

ie. /mail/jbloggs.nsf

TIA

Chris
0
Comment
Question by:mr880
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 5

Expert Comment

by:snocross
ID: 2788608
After the user logs on you need some way of calculating which mail file belongs to them.  You could have a lookup view that would list each persons log-on name and their corresponding mail file.  Using Lotusscript you could check this view when they click the OPEN MAIL button (or whatever you want to call it).  Or, if the mail files always used a consistent naming format you could calculate the filename based on that but it could be more tricky.  Once you have calculated which mail file is theirs you can call a Lotusscript agent that uses a print statement to open the desired URL.

For example:

 Print "[http:www.yourCompany.com/yourDirectory/JoeBlow.nsf]"
0
 
LVL 3

Accepted Solution

by:
Simon_Hendry earned 200 total points
ID: 2790402
The trick to this is to create an agent that is set to "run as web user" that way the session.effective user name will be the user name.

In your database create an agent ( I'll call it "mailfind" ) that is set to run from the "agent list" and is set to "Run once @Command may be used"

Make it run "script" with the code below:

After you have saved the agent ( obviously using an id that has access to run restricted agents on the server and has access to the NAB ) then goto the agents view in the database select this agent ( click only once ) then from the "agent" menu choose "agent properties" and then the "design" tab. Then select the "Run Agent As Web User" under the For Web Access:

If you don't do this then this code will also ways return the mail file of the person who wrote the agent not the mail file of the current user...

On your page simply put a link to the agent in the format

http://server/BDPAth/mailfind/?OpenAgent

When the user clicks on this link they will automatically be redirected to their mail file....

'Code Begins

Function ReplaceSubstring(sSource As String, sFrom As String, sTo As String) As String
     
     Dim sResult As String
     Dim i As Integer, iLenFrom As Integer, iLenRslt As Integer
     
     i=0
     iLenFrom=Len(sFrom)
     sResult=sSource
     
     Do While(i < Len(sResult))
         
          i=i+1
         
          If Mid$(sResult, i, iLenFrom ) = sFrom Then
               iLenRslt=Len(sResult)
               sResult=Left$(sResult, (i-1)) + sTo + Right$(sResult, iLenRslt - ( (i-1) + ( iLenFrom ) ) )
          End If
         
     Loop
     
     ReplaceSubstring=sResult
     
End Function

 Dim Sess As New NotesSession
     Dim MailServer As String
     Dim MailFile As String
     Dim UName As NotesName
     Dim SName As NotesName
     Dim UsersView As NotesView
     Dim UserDoc As NotesDocument
     
     ' Get the NAB
     Dim NAB As New NotesDatabase("","names.nsf")
     ' Get the $USers View
     Set UsersView = NAB.GetView("($Users)")
    ' Since this is a "Run as Web User" Agent the effective user will be the logged in user so get their abbreviated name and find their user
     ' document in the $USERS view
     Set UName = New NotesName(Sess.EffectiveUSerName)
     Set UserDoc = UsersView.GetDocumentbyKey(UName.Abbreviated)
'Now get their mailservers common Name
     Set SName = New NotesName(UserDoc.MailServer(0))
     
' Now redirect the user directly to their mail file
     
     Print "[http://" + SName.Common + "/" + ReplaceSubString(UserDoc.MailFile(0), "\","/") + "]"
     
     
'Code Ends
0
 

Author Comment

by:mr880
ID: 2817234
Adjusted points from 100 to 200
0
 

Author Comment

by:mr880
ID: 2817235
Thanks Simon,

Sorry I have not replied sooner, I have just been very busy.

I have increased the point value to 200 as an extra thank you.

Chris
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

730 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question