C#Lotus Notes - 已发送邮件不在

时间:2013-03-08 12:06:39

标签: c# email lotus-notes lotus

我正在使用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} = {“未在数据库上启用文件夹引用”}

BTW我也尝试用完全限定的路径(c:.... nsf)替换sFile,但结果是一样的。

任何人都可以给我一个提示,如何将邮件保存在输出文件夹中?

1 个答案:

答案 0 :(得分:0)

这条线让我感到奇怪:

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

不应该是:

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