我正在使用 Lotus Notes 从 C# 发送邮件,但发送的邮件不在数据库中,并且在输出文件夹中看不到。
我的代码是:
_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);
如果我在发送邮件之前检查 _notesDocument 的值,我会在 CreateDocument() 之后看到以下错误消息:
FolderReferences = "((Domino.NotesDocumentClass)(_notesDocument)).FolderReferences" hat eine Ausnahme vom Typ "System.Runtime.InteropServices.COMException" verursacht。(...导致了类型为...的异常) base {System.Runtime.InteropServices.ExternalException} = {“数据库上未启用文件夹引用”}
顺便说一句,我还尝试将 sFile 替换为完全限定的路径 (c:....nsf),但结果是一样的。
谁能给我一个提示,如何将邮件保存在输出文件夹中?