开发者

Automating Lotus Notes Text Style with perl?

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_ATTA开发者_如何学GoCHMENT,'','$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


My best guess:

my $richStyle = $Document->NotesRichTextStyle();

From the designer help:

Set notesRichTextStyle = notesSession.CreateRichTextStyle( )

You need to create the notesRichTextStyle using the session.


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


$ perl -Mdiagnostics -e " []->{1}=2 "
Not a HASH reference at -e line 1 (#1)
    (F) Perl was trying to evaluate a reference to a hash value, but found a
    reference to something else instead.  You can use the ref() function to
    find out what kind of ref it really was.  See perlref.

Uncaught exception from user code:
        Not a HASH reference at -e line 1.
 at -e line 1

so whatever NotesRichTextStyle returns doesn't like ->{...} so maybe use ->SetProperty... or something else :/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜