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?