简体   繁体   English

连接到远程Domino / Lotus Notes服务器以使用C#发送/检索用户邮件,联系人等

[英]Connecting to remote domino/lotus notes server to send/retrieve user mails, contacts, etc using C#

I am trying to create a web service using C#/.Net that can remotely access any user's lotus notes mailbox, contacts, etc. That is given the sever address and username/password details I want to send mails, create contacts, etc. Much like what one might do with EWS managed API for exchange accounts. 我正在尝试使用C#/。Net创建一个Web服务,该服务可以远程访问任何用户的Lotus Notes邮箱,联系人等。给定了我想发送邮件,创建联系人等的服务器地址和用户名/密码详细信息。就像可能使用EWS托管API进行交易的帐户一样。 I am currently using interop.domino.dll for this. 我目前正在为此使用interop.domino.dll。 It hasn't worked for me so far. 到目前为止,它对我没有用。

var session = new NotesSession();
session.InitializeUsingNotesUserName("username", "password");
var db = session.GetDatabase( "server", "xyz.nsf", false ); 

throws exception saying "user is not a server" or 引发异常,指出“用户不是服务器”或

"Failed to read server configuration" “无法读取服务器配置”

I am a total lotus newbie and any help would be appreciated. 我是一个莲花新手,任何帮助将不胜感激。

You mixed the server and client way to access the NotesSession. 您使用服务器和客户端的混合方式来访问NotesSession。 You have two choices: 您有两种选择:

  1. Client Way 客户方式

    session.Initialize("password"); or session.Initialize(); session.Initialize();

    Install a Notes Client and use Initialize() . 安装Notes客户端并使用Initialize() If the client is started you do not need to provide a password. 如果客户端已启动,则无需提供密码。 If the client is not started a password query will appear. 如果客户端未启动,将出现密码查询。 The client is using the configured notes.id and needs that password. 客户端正在使用配置的notes.id,并且需要该密码。 You could create a superuser id, that is capable to access all mail file and you do the authentication on your own. 您可以创建一个超级用户ID,该ID可以访问所有邮件文件,并且您可以自己进行身份验证。 Initialize (NotesSession - LotusScript®) 初始化(NotesSession-LotusScript®)

    This also should work on a server, but never tried this. 这也应该可以在服务器上工作,但请不要尝试这样做。

  2. Server Way 服务器方式

    session.InitializeUsingNotesUserName("username", "password");

    I never tried this, but mistakenly used the method, so I know it's an error to use it with a client. 我从没有尝试过,但是错误地使用了该方法,因此我知道与客户端一起使用是错误的。

    Theoretically: You Install a Domino Server and use the username and http-password of a user to identify as this user. 理论上:安装Domino服务器,并使用用户名和http-password标识为该用户。 I don't know if the dll find the right installation if you mix Notes Client and Server on on computer. 如果将Notes Client和Server混合在计算机上,我不知道dll是否找到正确的安装。 Theoretically this could be controlled by the path variable, which executables the dll can reach via path. 从理论上讲,这可以由path变量控制,dll可以通过path到达哪些可执行文件。 InitializeUsingNotesUserName (NotesSession - LotusScript®) InitializeUsingNotesUserName(NotesSession-LotusScript®)

    Domino Server on Windows Client: You can install a Domino Server on a Windows Client for testing purposes, the server will have limited network connections, because of the windows client, but it's utilizable for development. Windows客户端上的Domino服务器:您可以在Windows客户端上安装Domino服务器以进行测试,由于Windows客户端的原因,该服务器的网络连接有限,但可用于开发。 Bear in mind the EULA for Microsoft and IBM. 请记住针对Microsoft和IBM的EULA。

interop.domino.dll is not in focus of IBM any more. interop.domino.dll不再是IBM的重点。 So think about what Richard Schwartz said and focus on the existing REST API or write your own web services as Notes Database and access it from C# as web service. 因此,请考虑一下Richard Schwartz所说的内容,并专注于现有的REST API,或者将自己的Web服务编写为Notes数据库,然后从C#作为Web服务访问它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM