Can anyone explane to me: how to create a link to a users mail file on the homepage.nsf?This should work for every user… I mean, I can create a link to “mail\mailfile.nsf” but it should be different for every user)
If user1 accesses the webpage, the link should point to: mail\user1.nsf
Subject: homepage.nsf: add link to users mail file
Create a Link Hotspot. Choose ‘Named Element’ as the type of item to link to. Choose ‘Frameset’ as the subtype. Click on the Browse button (the little folder one.) In the second drop-down box you can choose from a list of databases to get the frameset out of - one of the options is ‘-User’s Mailfile-’
Subject: RE: homepage.nsf: add link to users mail file
Oops - my bad. I didn’t notice it was on the web.
A quick bit of research turned up the following advice…
Redirecting users to their mail files once they have connected to the server can be achieved through a form/document in the server’s homepage db. Create a link hotspot in the form with @Formulae to generate the URL - one possible set of @Formulae is as follows:
mailServer := @DbLookup (“”:“nocache”;“”:“names.nsf”;“($NamesFieldLookup)”;Username;“Mailserver”);
mailServerURL := @DbLookup (“”:“nocache”;“”:“names.nsf”;“($ServersLookup)”;mailServer;“HTTP_HostName”);
mailFile := @LowerCase(@DbLookup (“”:“nocache”;“”:“names.nsf”;“($NamesFieldLookup)”;UserName;“Mailfile”));
REM “The next line removes any carriage returns that have been accidentally entered in the MailFile field in the Person doc and adds .nsf if it is missing”;
mailFileURL := @Left(@Trim(@Explode(mailFile; @Char(13))) + “.”; “.”) + “.nsf”;
“http://” + mailServerURL + “/” + mailFileURL + “?opendatabase&login”;
This code assumes that you have already got the username and stored it in a field called Username. You should modify and test the code - my typing isn’t as good as it should be
Hopefully this should help you get onto the right track
REM {The next line removes any carriage returns that have been accidentally entered in the MailFile field in the Person doc and adds .nsf if it is missing};
Hi Rob,we use an agent, that points to the mailfile even if not on the same server…
called OpenWebMail
Option Public
Option Declare
Sub Initialize
Dim doc As NotesDocument
Dim EnvDoc As NotesDocument
Dim db As NotesDatabase
Dim v As NotesView
Dim s As New NotesSession
On Error Goto Err_OWM
Set db = New NotesDatabase("","names.nsf")
Set EnvDoc = s.DocumentContext
If Not db.isOpen Then
db.Open "",""
End If
Set v = db.Getview("($Users)")
Set doc = v.GetDocumentByKey(EnvDoc.Remote_User(0))
If doc Is Nothing Then
Print "Your entry was not found in the Domino Directory, pls. check with the admins!"
Else
Print "[https://"+pureServer(doc.MailServer(0))+"/"+puremailFile(doc.MailFile(0))+".nsf?OpenDatabase]"
End If
Exit_OWM:
Exit Sub
Err_OWM:
Print Error$
Resume Exit_OWM
End Sub
Function pureServer(inString) As String
Dim nn As NotesName
Set nn = New NotesName(inString)
pureServer = nn.Common
End Function
Function puremailFile(inString) As String
Dim i As Integer
Dim outstring As String
Dim curChar As String
outstring=""
For i = 1 To Len(inString)
curChar = Mid$(inString,i,1)
If curChar="\" Then
outstring = outstring+"/"
Else
outstring = outstring + curChar
End If
Next
puremailfile = outstring