Solved

Accessing Mail files via webpage

Posted on 2000-05-08
4
185 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
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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
IBM Notes offer Encryption feature using which the user can secure its NSF emails or entire database easily. In this section we will discuss about the process to Encrypt Incoming and Outgoing Mails in depth.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

813 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

12 Experts available now in Live!

Get 1:1 Help Now