Solved

Accessing Mail files via webpage

Posted on 2000-05-08
4
183 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
  • 2
4 Comments
 
LVL 5

Expert Comment

by:snocross
Comment Utility
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
Comment Utility
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
Comment Utility
Adjusted points from 100 to 200
0
 

Author Comment

by:mr880
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

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…
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now