Link to home
Start Free TrialLog in
Avatar of manoj Gaddale
manoj Gaddale

asked on

Notes error: Notes shared login failed with this ID file

I am using lotus notes to send email in .net application using c#. I am able to send mails from this application while i run this in my local host. But the thing is when host the application in local IIS server i am not able to send mails.
 I am getting the following error.
Notes error: Notes shared login failed with this ID file.
Please tell me why i am getting this error after hosting the application.
Avatar of Sjef Bosman
Sjef Bosman
Flag of France image

The COM interface always needs a local Lotus Notes installed.

How did you "host" the application? And what code did you use to send your mails through Notes?
Avatar of manoj Gaddale
manoj Gaddale

ASKER

Local Lotus is already installed in my machine.. i hosted the application in IIS server. It is working fine in local. once i publish in iis i am getting error..

  NotesSession _notesSession = new NotesSession();
                    NotesDocument _notesDocument = null;
                    NotesDatabase _notesDataBase = null;
                    string sServerName = "servername";
                    string sMailFile = "mail/IN/names.nsf";
                    string password = "password";
                    string sSendTo = ASPxTextBox1.Text;
                    string sSubject = ASPxTextBox2.Text;
                    string[] elist = { "example@gmail.com"};

                    _notesSession.Initialize(password);
                    _notesDataBase = _notesSession.GetDatabase(sServerName, sMailFile, false);
                    if (!_notesDataBase.IsOpen)
                    {
                        _notesDataBase.Open();
                    }
                    _notesDocument = _notesDataBase.CreateDocument();
                    _notesDocument.ReplaceItemValue("frommail", "Memo");
                    _notesDocument.ReplaceItemValue("SendTo", sSendTo);
                    _notesDocument.AppendItemValue("CopyTo", "");
                    NotesItem item = _notesDocument.GetFirstItem("CopyTo");
                foreach(var v in elist){
                    item.AppendToTextList(v);
                }
                    _notesDocument.ReplaceItemValue("Subject", sSubject);
                    NotesRichTextItem _richTextItem = _notesDocument.CreateRichTextItem("Body");
                    _richTextItem.AppendText(TextBox1.Text + "\r\n");
                 
                    _notesDocument.Send(false);
                    _richTextItem = null;
                    _notesDocument = null;
                    _notesDataBase = null;
                    _notesSession = null;
As far as I know, you can simply write

       _notesDocument.ReplaceItemValue("CopyTo", elist);

Could it be that IIS is started as a service, and therefore runs as a "different" user? Notes is by definition a single user client, which is why it may refuse your code.

Suggestion: you can write web services in Domino, and use them in your application...
I already used Domino service in my application.
_notesDocument.ReplaceItemValue("CopyTo", elist); is not the problem it is working fine. My problem is  i am unable to login to mail when i hosted application in IIS.
> I already used Domino service in my application.
I meant: use a web service on a Domino server, but I suppose it doesn't really apply in your situation, where you want to use a local Notes environment to handle mails. Sorry for the confusion.

> ... is not the problem
I know, it was just an observation.

> .. unable to login to mail
I don't know too much about IIS/VB/.Net, but it's my understanding of the Windows environment that IIS isn't started as a user process but as a service, and that it can't use the credentials of the current user. In this document (http://www-01.ibm.com/support/docview.wss?uid=swg21406937), they mention a .bin file that's in the user's environment. I guess IIS doesn't have access to the user's environment. That would explain it for me, anyway, but I'm not an expert on this matter.

What exactly do you want to do with your VB application when it runs under IIS? Do you want to send mails from a web page or so? There are possibilities to do this with IIS and Domino, but Notes runs only as a client environment...
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.