我正在使用Interop.Domino.dll并能够通过c#代码向Lotus Notes 8.5用户发送邮件。 现在我想通过c#代码向用户发送约会邀请。
这是我的代码。
oNotesDocument.ReplaceItemValue("Form", "Appointment");
oNotesDocument.ReplaceItemValue("AppointmentType", "3"); // meeting
oNotesDocument.ReplaceItemValue("Subject", "Deneme Toplantı");
oNotesDocument.ReplaceItemValue("CALENDARDATETIME", StartDate);
oNotesDocument.ReplaceItemValue("StartDateTime", StartDate);
oNotesDocument.ReplaceItemValue("EndDateTime", EndDate);
oNotesDocument.ReplaceItemValue("StartDate", StartDate);
//oNotesDocument.ReplaceItemValue("MeetingType", "1");
oNotesDocument.ReplaceItemValue("Required", "xx\\xx.xx");
oNotesDocument.ReplaceItemValue("SendTo", "xx@xx.com");
oNotesDocument.ReplaceItemValue("From", "xx@xx.com");
oNotesDocument.ReplaceItemValue("Principal", "pr.incipal");
oNotesDocument.ReplaceItemValue("Chair", "erdem.tomus");
oNotesDocument.ReplaceItemValue("Location", "location test");
oNotesDocument.ReplaceItemValue("Body", an invitation");
oNotesDocument.ComputeWithForm(true, false);
oItemValue = oNotesDocument.GetItemValue("SendTo");
//Send the email
oNotesDocument.Send(false, ref oItemValue);
我可以发送邀请,但我无法向参与者填写莲花笔记预约表格的哪一部分。我将非常感谢您的帮助。 事实上,我需要在属性上使用ReplaceItemValue,但它不能像那样工作。 感谢
答案 0 :(得分:4)
当约会表单打开时,使用“EnterSendTo”字段让用户输入会议的与会者。我相信一旦发送会议,就会转换为文档中的“RequiredAttendees”项目。
您可以尝试使用代码:
oNotesDocument.ReplaceItemValue("EnterSendTo", "xx@xx.com");
在调用ComputeWithForm之前放置它,它应该工作。否则,请尝试替换RequiredAttendees项的值,看看是否有效。
或者,您可以使用iCal格式发送日历条目。快速搜索SO让我想到了这个问题:Creating iCal Files in c#。看来有一个可以用来生成iCal文件的体面C#类库,而Domino邮件应该识别它们。