使用 perl 自动化 Lotus Notes 文本样式?
我正在尝试自动发送带有嵌入附件和一些实现 HTML 代码的文本的电子邮件,但似乎我使用的代码不允许我创建 HTML 粗体文本或无序列表。为了仔细检查,我在 vba 中创建了代码,然后将其通过 vba 到 perl 转换器传递,它与我编写的内容相匹配。这是我的脚本的一部分,用于处理在电子邮件中创建文本和嵌入附件:
my $richStyle = $Document->NotesRichTextStyle();
$richStyle->{'PassThruHTML'} = 1;
my $Body = $Document->CreateRichTextItem('Body');
$Body->AppendText(">>EOT");
$Body->AppendStyle($richStyle);
**$Body->AppendText("<b>HELLO</b>");**
$Body->EmbedObject(EMBED_ATTACHMENT,'','$filename','$name');
我收到此错误:
$richStyle->{'PassThruHTML'} = 1 行不是哈希引用;
这段代码的要点是让我可以在电子邮件中使用 HTML 标签
I'm trying to automate the sending of an email with an embedded attachment and some text that implements HTML code but it seems that the code that I am using will not allow me to create an HTML bolded text or a unordered list. To double check I created the code in vba then passed it through a vba to perl converter and it matched up with what I had written. Here is the part of my script that handles creating the text and embedded attachment in the email:
my $richStyle = $Document->NotesRichTextStyle();
$richStyle->{'PassThruHTML'} = 1;
my $Body = $Document->CreateRichTextItem('Body');
$Body->AppendText(">>EOT");
$Body->AppendStyle($richStyle);
**$Body->AppendText("<b>HELLO</b>");**
$Body->EmbedObject(EMBED_ATTACHMENT,'','$filename','$name');
I get this error:
Not a HASH reference at line $richStyle->{'PassThruHTML'} = 1;
The main point of this code was so that i could use HTML Tags inside the email
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我最好的猜测:
来自设计器帮助:
您需要使用会话创建notesRichTextStyle。
My best guess:
From the designer help:
You need to create the notesRichTextStyle using the session.
我猜您想创建 HTML 邮件?
在这种情况下,最好使用 MIME 实体类来生成本机 HTML 邮件,而不是依赖 NotesRichText 到 HTML 的转换。
您可以在 Designer 帮助中找到有关 MIME 实体的更多信息:http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/index.jsp?topic=/com.ibm.designer.domino.main.doc/H_NOTESMIMEENTITY_CLASS_OVERVIEW.html
I guess you want to create an HTML mail?
In that case, it would be better to use the MIME entity classes to generate native HTML mails and not to rely on the NotesRichText to HTML conversion.
You can find more info on the MIME entity in the Designer Help: http://publib.boulder.ibm.com/infocenter/domhelp/v8r0/index.jsp?topic=/com.ibm.designer.domino.main.doc/H_NOTESMIMEENTITY_CLASS_OVERVIEW.html
所以无论 NotesRichTextStyle 返回什么都不喜欢
->{...}
所以可能使用->SetProperty...
或其他东西:/so whatever NotesRichTextStyle returns doesn't like
->{...}
so maybe use->SetProperty...
or something else :/