[Help] Problems using .NET to send e-mail via Domino DLL?

Hi all,

I’ve been having numerous problems with sending an e-mail via my Lotus Notes database using ASP.Net referencing the Domino DLL and was hoping someone could help me figure out why I keep getting the message “could not open the ID file”

My Settings

Notes.ini is located in c:\documents and settings\nwalsh\Local Settings\Application Data\Lotus\Notes\Data

nwalsh.id is also located here with KeyFilename=nwalsh.id

My Code

Public Sub TestNotesAccess()

        Dim NotesSession As Domino.NotesSession

        Dim NotesDirectory As Domino.NotesDbDirectory

        Dim NotesDatabase As Domino.NotesDatabase



        Try

            Response.Write("Mail Server: " & ConfigurationSettings.AppSettings("MailDirectory") & "<br>")

            Response.Write("Mail Database: " & ConfigurationSettings.AppSettings("MailDatabase") & "<br>")

            Response.Write("Mail Password: " & ConfigurationSettings.AppSettings("MailPassword") & "<br />")

            NotesSession = New Domino.NotesSession

            Response.Write("NotesSession Created<br>")



            NotesSession.Initialize(ConfigurationSettings.AppSettings("MailPassword"))

            Response.Write("NotesSession Initialized<br>")



            NotesDirectory = NotesSession.GetDbDirectory(ConfigurationSettings.AppSettings("MailDirectory"))

            Response.Write("NotesDirectory Successful<br>")



            NotesDatabase = NotesDirectory.OpenDatabase(ConfigurationSettings.AppSettings("MailDatabase"), True)

            Response.Write("NotesDatabase Selected<br>")



            If NotesDatabase.IsOpen Then

                Response.Write("Lotus Notes Successfully Accessed.<br>")

                Response.Write("Using Mail File: " & NotesDatabase.Title & "<br>")

            End If



        Catch ex As Exception

            Response.Write("An error happened.<br>")

            Response.Write(ex.Message & ("<br>"))

            Response.Write(ex.Source & ("<br>"))



        Finally

            'Clean Up!

            NotesDatabase = Nothing

            NotesDirectory = Nothing

            NotesSession = Nothing



        End Try



    End Sub

My Output & Error

Mail Server: NAUNB219

Mail Database: mail\nwalsh.nsf

Mail Password: test1234

NotesSession Created

An error happened.

Notes error: Could not open the ID file

NotesSession

Other Factors

  • There’s another notes.ini file located under C:\Documents and Settings\MBKW053661\ASPNET\Local Settings\Application Data\Lotus\Notes\Data

  • I have a reference in my path to c:\documents and settings\nwalsh\Local Settings\Application Data\Lotus\Notes\Data

  • I have given the ASPNET machine account access to the notes.ini file under c:\d&s\nwalsh\etc…

So, anyone got any ideas or know of a step by step guide to getting this going on a machine? I’ve been having too many problems which I think may have something to do with the fact that my notes is a multi-user install

Subject: [Help] Problems using .NET to send e-mail via Domino DLL?

You shouldn’t have to deal with the .ini file. Initialize the session without parameters which will pickup whatever the default locations are.

That may fail with a notes.ini not found if it’s in a non-standard location. Our application prompts in that case (which may not be correct).

-dB.