Link to home
Start Free TrialLog in
Avatar of Stephen Forero
Stephen ForeroFlag for United States of America

asked on

View Specific Email from Lotus Notes in webbrowser box using URL

Is it possible to view a specific email in the webbrowser box, using a universal ID.
I have the ID... 5FF71981414FAF6185257892005C6304
and I know my mail server... but not sure if possible, how to put together to view in a webbrowser box.

it would have to login somehow to work email system

goal is to print this since printing straight from c# into lotus notes does not seem possible.

using a windows application in visual studio 2010 express c#.

thanks!!

thanks
Avatar of Stephen Forero
Stephen Forero
Flag of United States of America image

ASKER

also, I know I can paste the link from the actual emails properties window.
But that opens it in lotus notes... which is right back to where I started.  I can't find a way to print it...
which is the goal... honestly don't even need to open it as long as it prints.

thanks!!
ASKER CERTIFIED SOLUTION
Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
So I successfully pulled the lotus notes email in a webbrowser box on a windows form.
I have to hit enter 2x to authenticate certificates.  Any way around hitting enter?
Is there a way to use SendKeys in C#?
yes there is, I'll work on that.

next issue with this

http:///prudomino.prudential.com/njros1nml45/x152169.nsf/0/A5D9D44D607ECF268525789200763A5A
this is my info above which does NOT retrieve file


however, if I go to actual properties of file its much longer than just universal ID -- this works
https://prudomino.prudential.com/njros1nml45.prudential.com/8525740F005E2540/DABA975B9FB113EB852564B5001283EA/A5D9D44D607ECF268525789200763A5A

I do not know what these extra values are, and until I do I cannot retrieve them from lotus notes using variables.

any thoughts?
In the first URL there is a slash too many at the start.

In the 2nd one, the path is different, the first ID is the replica ID of the x152169.nsf database, the second ID is the UniqueID of the view, and the last ID is the same as in the first one.

Hope it explains something.
thanks, it does help, now to retrieve the :
 the first ID is the replica ID of the x152169.nsf database
 = 8525740F005E2540

Do you know how to retrieve this?  Should I make a new post in the forum for this retrieval only?

When I step through my program, under the variable LAST DOCUMENT, I see that code under:
notesURL

But I dont see a method to call only this.

NotesSession _notesSession = new NotesSession();
        NotesDatabase _notesDataBase = null;
        NotesDocument _notesDocument = null;
        string sServerName = comboBox1.Text;//"NJROS1NML45/SERVER/Prudential"; //ConfigurationManager.AppSettings["NJROS1NML45/SERVER/Prudential"];
        string sMailFile = "/Mail/" + login + ".nsf";  //"/Mail/x152169.nsf"; //ConfigurationManager.AppSettings["x152169"];
        string password = login; //ConfigurationManager.AppSettings["x152169"];
        object oItemValue = null;
        _notesSession.Initialize(password);
        _notesDataBase = _notesSession.GetDatabase(sServerName, sMailFile,
            false);
        //If the database is not already open then open it. 
        if (!_notesDataBase.IsOpen)
        {
            _notesDataBase.Open();
        }

        NotesView _notesView = null;
        _notesView = _notesDataBase.GetView("$Sent");

        NotesDocument lastdocument = _notesView.GetFirstDocument();

Open in new window

so I found the ID I was looking for
replicaID = _notesDataBase.ReplicaID;

Open in new window


now if I'm not too much of a bother if you could help me find the server name without specifying it.

I tried notessession current database but I am finding:
 The CurrentDatabase property of NotesSession is not available if you are running outside of Notes/Domino (ie: COM)
 
You don't have to retrieve the replica ID. You can just use "database.nsf" instead... See my first post. I hope you try every URL by typing it into your browser's address bar.

As for the server name... You might be able to extract it from your notes.ini file. There is a line with
      MailServer=
but it won't help you much, for you need the IP-address or the DNS-name of the server. On our server, even the IP-address won't help, the server insists on having a name related to a website.

I think it's better to have this parameter as one of the configurable options of your application.
I'm not following...
database.nsf I'm assuming in my example is x152169.nsf

On the original email you mentioned
http://server/path/database.nsf/0/UniqueID

When you say your server insists on having a name related to a website... what do you think this would be in my case...
would it be = //prudomino.prudential.com?

And lastly, what is a DNS?

I know you can't test it, but if you had to guess how I should enter this please do so.

again.. this is the URL that worked
https://prudomino.prudential.com/njros1nml45.prudential.com/replicaID/0/UniqueID



I asked our IT dept... and they have me my DNS address, (which they say is my computer name)
W-D5FRQSF1

is this what you are referring to?  And if so where do you think I should put it?
http://server/path/database.nsf/0/UniqueID

https://prudomino.prudential.com/njros1nml45.prudential.com/replicaID/0/UniqueID

server=prudomino.prudential.com
path=njros1nml45.prudential.com (apparently the directory is called like that)
database.nsf=replicaID  but could equally well have been x152169.nsf
0=standard available view indexed on uniqueID
uniqueID= the search key in the standard view

DNS= Domain Name Server, it "translates" names into IP-addresses, e.g. prudomino.prudential.com into 11.22.33.44
Your own computer is irrelevant, you need the server's name don't you?

There's one more difference in both URLs above: http or https (https means HTTP with SSL encryption)

http://www.ibm.com/developerworks/lotus/library/ls-Domino_URL_cheat_sheet/
so this is what I'm trying and still not working

Domino URL commands have the following syntax:
http://Host/Database/DominoObject?Action&Arguments 
Where:

•Host is the DNS entry or IP address.
•DominoObject is a Domino construct (such as a database, view, document, form, navigator, agent, and so on).
http://48.27.193.68/8525740F005E2540/0/A5D9D44D607ECF268525789200763A5A

host IP = 48.27.193.68
database = 8525740F005E2540    or x152169.nsf
Domino Object
0/A5D9D44D607ECF268525789200763A5A
0 for view then ID

with no luck... and tried both http and https
And where's the path-part?
then I believe I mis-represented something else as well.

If would be nice if I could assign the path by calling it instead of me have to code it into a variable manually.

so now I'm looking for some property/method to return = path=njros1nml45

notessession.currentdatabase.server would work... but it is not returning anything .  I'm guess this is why
The CurrentDatabase property of NotesSession is not available if you are running outside of Notes/Domino (ie: COM)

thoughts?.. or am I SOL
Again, you need to go from the URL that works. It is really very straightforward:

protocol ::// host / path / database.nsf / view / id ? action

If the database is in the main data directory of the Domino server, there is no path. Similarly, if you use the replica-ID instead of database.nsf, you don't specify the path, for the Domino server will find the database by the unique replica-ID. The action here would be OpenDocument.

So, with the replica-ID, you get (spaces added for lisibility):

http ::// 48.27.193.68 / 8525740F005E2540 / 0 / A5D9D44D607ECF268525789200763A5A ? OpenDocument


Now about the server. I assume you still have a connection with the server using C#. If you want to do this the right way, you have to:
- open names.nsf on the server
- get the Servers view
- find the Server document for the current server
- get the content of field SMTPFullHostDomain

This will get you the server's address, but only if your server doesn't host multiple websites.
1.Regarding the server... if I was able to return the value, I was going to use it to establish the connection.  So I would need a way to find it without specifying it anywhere.

2.https://prudomino.prudential.com/njros1nml45.prudential.com/8525740F005E2540/0/A5D9D44D607ECF268525789200763A5A?OpenDocument
works

https://prudomino.prudential.com/njros1nml45.prudential.com/8525740F005E2540/By+Rep/A5D9D44D607ECF268525789200763A5A?OpenDocument
works

https://48.27.193.68/8525740F005E2540/0/A5D9D44D607ECF268525789200763A5A?OpenDocument
does not.


Am I beating a dead horse here?
Maybe you have to ask an Admin, maybe the address isn't right or so.

Wouldn't it be easier to allow the user of the application to supply the server-part, in some configuration setting?
Yes, I have it as a dropdown box now and the majority of users will not have to change the dropdown.  I was just looking for it to be completely gone from user.

Either way, thank you so much for all the help, can't tell you how much I appreciate your patience!

Hopefully this section of the project will be done..... for now. ha
Thanks as well!!

And there must be greener sections than this one... ;-)