Simon,
The Teamroom database launches with a Domino frameset on the Notes client, and in an XPage on the Web.
My application is pure XPages. I have tried every facesContext, session, and database property I thought might be useful, and none of them provided the makings of a usable URL link for inclusion in an email when running on the Notes client.
What I am thinking of doing is storing the Web URL in an application profile document. When I call the Mail function in my script library, if @ClientType=="Web" I will store the URL in the profile document. If @ClientType=="Notes" I will retrieve the URL from the profile document to append to the body of my email.