2

I'm sending mails from C# using Lotus Notes, but the sent mails are not in the database and can not be seen in the output folder.

My code is:

_notesSession = new NotesSession();
string sPassword = "";
_notesSession.Initialize(sPassword);
string sServer = "";
string sFile = "data\mailfilename.nsf";
_notesDataBase=_notesSession.GetDatabase(sServer, sFile, false);
// not: _notesDataBase=_notesSession(GetDatabase(sServer, sFile, false));
if (!_notesDataBase.IsOpen) _notesDataBase.Open();
_notesDocument = _notesDataBase.CreateDocument();
_notesDocument.SaveMessageOnSend = true;
.
.
.
_notesDocument.Save(true,false);
_ItemValue = _notesDocument.GetItemValue("SendTo");
_notesDocument.Send(false, ref _ItemValue);

If I check the value of _notesDocument before sending the mail, I see the following error message after CreateDocument():

FolderReferences = "((Domino.NotesDocumentClass)(_notesDocument)).FolderReferences" hat eine Ausnahme vom Typ "System.Runtime.InteropServices.COMException" verursacht. (... has caused an exception with type of...) base {System.Runtime.InteropServices.ExternalException} = {"Folder References are not enabled on the database"}

BTW I also tried to replace the sFile with the fully qualified path (c:....nsf), but the result is the same.

Can anybody give me a hint, what to do to save the mail in the output folder?

Martin S
  • 31
  • 4
  • I don't know what your configuration looks like, but normally "data" is the root of the file tree for Lotus Notes database, and it would not be included in a relative file path, so insted of "data\mailfilename.nsf", it would just be "mailfilename.nsf", or maybe "mail\filename.nsf". – Richard Schwartz Mar 08 '13 at 15:35
  • Also, what do you mean by "the output folder". The normal location for sent mail in Lotus Notes is the Sent view. (A view is not the same thing as a folder.) – Richard Schwartz Mar 08 '13 at 15:36

1 Answers1

0

This line strikes me as odd:

_notesDataBase=_notesSession(GetDatabase(sServer, sFile, false));

Shouldn't it be:

_notesDataBase= _notesSession.GetDatabase(sServer, sFile, false);
D.Bugger
  • 2,300
  • 15
  • 19
  • The second one is the one I use. I filled it in here in a worg way. An I correct it in my question. -sorry- – Martin S Mar 11 '13 at 09:53