gpt4 book ai didi

c# - Lotus Note PassThruHTML

转载 作者:太空宇宙 更新时间:2023-11-03 20:20:59 25 4
gpt4 key购买 nike

我正在尝试在“domino”dll(编程语言:C#)的帮助下使用 LOTUS NOTES 发送电子邮件。

我想在电子邮件正文中附加邮件签名。我希望为签名添加 .jpg。我还有其他电子邮件正文格式。因此,我决定使用 HTML 来设计样式和附加签名。浏览网页后发现在NotesRichTextStyle中有一个属性PassThruHTML。根据此 link 可以为其赋予的合法值是(-1),(0),(255)。

问题是,当我设置 (-1) 时,应用会弹出一条消息,指出“样式值必须为 True、False 或 STYLE_NO_CHANGE(对于 Java 而言是、否或可能)”。

但在 c sharp 代码中它只接受 int 值而不接受弹出窗口中给出的值。

最佳答案

以下是 Ken Pespisa 的引用链接给出的答案的 C# 代码。

NotesSession LNSession = new NotesSession();
NotesDatabase LNDatabase = null;
NotesDocument LNDocument;
NotesMIMEEntity LNBody;
NotesStream LNStream;
NotesMIMEHeader LNHeader;

try
{
LNSession.Initialize(txtPassword.Text);
LNDatabase = LNSession.GetDatabase(txtServer.Text, txtUserName.Text, false);
LNStream = LNSession.CreateStream();
LNSession.ConvertMime = false;

//Create an email
LNDocument = LNDatabase.CreateDocument();
LNDocument.ReplaceItemValue("Form", "Memo");
LNBody = LNDocument.CreateMIMEEntity();

LNHeader = LNBody.CreateHeader("Subject");
LNHeader.SetHeaderVal("Add your subject here");

LNHeader = LNBody.CreateHeader("To");
LNHeader.SetHeaderVal("Give your recipient email address");

LNStream.WriteText("<html>");
LNStream.WriteText("<body bgcolor=\"blue\" text=\"white\">");
LNStream.WriteText("<table border=\"2\">");
LNStream.WriteText("<tr>");
LNStream.WriteText("<td>Hello World!</td>");
LNStream.WriteText("</tr>");
LNStream.WriteText("</table>");
LNStream.WriteText("</body>");
LNStream.WriteText("</html>");
LNBody.SetContentFromText(LNStream, "text/HTML;charset=UTF-8", MIME_ENCODING.ENC_IDENTITY_7BIT);
LNDocument.Send(false);
}
catch (Exception e)
{
MessageBox.Show(e.Message);
}

关于c# - Lotus Note PassThruHTML,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13604002/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com